package com.esd.csair;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.w3c.dom.Node;

import com.esd.common.AutoDiscern;
import com.esd.common.InputStreamUtils;
import com.gargoylesoftware.htmlunit.AjaxController;
import com.gargoylesoftware.htmlunit.AlertHandler;
import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.ConfirmHandler;
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
import com.gargoylesoftware.htmlunit.NicelyResynchronizingAjaxController;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.ScriptResult;
import com.gargoylesoftware.htmlunit.StatusHandler;
import com.gargoylesoftware.htmlunit.WebRequest;
import com.gargoylesoftware.htmlunit.html.DomElement;
import com.gargoylesoftware.htmlunit.html.DomNode;
import com.gargoylesoftware.htmlunit.html.DomNodeList;
import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
import com.gargoylesoftware.htmlunit.html.HtmlButton;
import com.gargoylesoftware.htmlunit.html.HtmlCheckBoxInput;
import com.gargoylesoftware.htmlunit.html.HtmlDivision;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlImage;
import com.gargoylesoftware.htmlunit.html.HtmlInput;
import com.gargoylesoftware.htmlunit.html.HtmlLabel;
import com.gargoylesoftware.htmlunit.html.HtmlListItem;
import com.gargoylesoftware.htmlunit.html.HtmlOption;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlParagraph;
import com.gargoylesoftware.htmlunit.html.HtmlPasswordInput;
import com.gargoylesoftware.htmlunit.html.HtmlSelect;
import com.gargoylesoftware.htmlunit.html.HtmlSpan;
import com.gargoylesoftware.htmlunit.html.HtmlStrong;
import com.gargoylesoftware.htmlunit.html.HtmlTable;
import com.gargoylesoftware.htmlunit.html.HtmlTableBody;
import com.gargoylesoftware.htmlunit.html.HtmlTableRow;
import com.gargoylesoftware.htmlunit.html.HtmlTextArea;
import com.gargoylesoftware.htmlunit.html.HtmlUnorderedList;
import com.gargoylesoftware.htmlunit.javascript.JavaScriptErrorListener;

import net.sf.json.JSONObject;

public class CsairImpl implements Serializable, Csair {
	private static Logger log = Logger.getLogger(CsairImpl.class);
	private static final long serialVersionUID = -7875415267036012443L;
	private CsairWebClient webClient = null;
	private SimpleConectionListener scl = null;
	private JavaScriptErrorListener jsel = null;
	private Integer timeoutmax = 50;
	private Long waittime = 1000L;
	private String alertMessage = null;
	private String confirmMessage = null;
	private String URLflightQuery = null;
	private String URLlcExchangeListPage = null;
	private String URLflightDynamicsPlace = null;
	private String URLflightDynamicsNum = null;

	public static void main(String[] args) {
		CsairWebClient webClient = null;
		JavaScriptErrorListener jsel = null;
		webClient = new CsairWebClient(BrowserVersion.CHROME);
		jsel = new JavaScriptErrorListenerEx();
		webClient.setJavaScriptErrorListener(jsel);
		

		webClient.getOptions().setTimeout(15 * 60 * 1000);// 设置“浏览器”的请求超时时间 15分钟
		webClient.getOptions().setMaxInMemory(768000);
		webClient.getOptions().setRedirectEnabled(true);
		webClient.getOptions().setThrowExceptionOnScriptError(false);// 当JS执行出错的时候是否抛出异常
		webClient.getOptions().setThrowExceptionOnFailingStatusCode(true);// 当HTTP的状态非200时是否抛出异常
		webClient.getOptions().setCssEnabled(true);// 是否启用CSS
		webClient.getOptions().setJavaScriptEnabled(true); // 很重要，启用JS
		webClient.setJavaScriptTimeout(100000);// 设置JS执行的超时时间
		webClient.waitForBackgroundJavaScript(10000);// 设置JS后台等待执行时间
		webClient.setAjaxController(new NicelyResynchronizingAjaxController());// 设置支持AJAX
		webClient.getOptions().setUseInsecureSSL(true);// SSL
		webClient.getCookieManager().setCookiesEnabled(true);
		
	
		String url="http://qianshouzhaopin.com/admin/login";
		CsairPage pageLogin = webClient.getCsairHtmlPage(url, "URLqianshoulogin",false);

		log.info("====================loadPageHandler=========================");
		for (int i = 0; i <= 100; i++) {

			if (pageLogin.getHtmlPage() == null) {
				pageLogin.setPRE(CS.FAIL);
				log.info(pageLogin.getPRE());
				System.out.println("fail");
			}
			Object obj = pageLogin.getHtmlPage().getFirstByXPath("//input[@id='code']");
			if (obj != null) {
				pageLogin.setPRE(CS.SUCCESS);
				log.info(pageLogin.getPRE());
				System.out.println("success");
				
				HtmlPage page = pageLogin.getHtmlPage();
				HtmlSpan codeSpan = (HtmlSpan) page.getBody().getElementsByAttribute("span", "class", "code").get(0);
				HtmlImage codeImg = (HtmlImage) codeSpan.getElementsByTagName("img").get(0);
				String codeImgSrc = codeImg.getAttribute("src");
				System.out.println("codeImgSrc===>"+codeImgSrc);
				try {
					image2Bytes(codeImgSrc);
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				break;
			}
			synchronized (pageLogin) {
				try {
					pageLogin.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
					pageLogin.setPRE(CS.FAIL);
					pageLogin.getHtmlPage().cleanUp();
					log.info(pageLogin.getPRE());
					System.out.println("catch fail");;
				}
				pageLogin.setPRE(CS.LOADING);
				log.info(pageLogin.getPRE());
			}
		}
		pageLogin.setPRE(CS.TIMEOUT);
		pageLogin.getHtmlPage().cleanUp();
		log.info(pageLogin.getPRE());
		System.out.println("timeout");
	
		
		
	}

	
	
	static byte[] image2Bytes(String imgSrc) throws Exception
    {
        FileInputStream fin = new FileInputStream(new File(imgSrc));
        //可能溢出,简单起见就不考虑太多,如果太大就要另外想办法，比如一次传入固定长度byte[]
        byte[] bytes  = new byte[fin.available()];
        //将文件内容写入字节数组，提供测试的case
        fin.read(bytes);
        
        fin.close();
        return bytes;
}




	public CsairImpl() {
		webClient = new CsairWebClient(BrowserVersion.CHROME);
//		webClient = new CsairWebClient(BrowserVersion.INTERNET_EXPLORER);
		jsel = new JavaScriptErrorListenerEx();
		webClient.setJavaScriptErrorListener(jsel);
		webClient.setConfirmHandler(new ConfirmHandler() {
			public boolean handleConfirm(Page page, String message) {
				confirmMessage = message;
				log.error("***************************************");
				log.error("handleConfirm:" + message);
				log.error("***************************************");
				return true;//返回true默认点击“确定”，返回false则点击“取消”
			}
		});
		webClient.setAlertHandler(new AlertHandler() {
			public void handleAlert(Page page, String message) {
				alertMessage = message;
				log.info("***************************************");
				log.info("handleAlert:" + message);
				log.info("***************************************");
			}
		});
		webClient.setAjaxController(new AjaxController() {
			private static final long serialVersionUID = 7824466494627032976L;

			@Override
			public boolean processSynchron(HtmlPage page, WebRequest request, boolean async) {

				log.info("processSynchron===================" + request.getUrl());
				return super.processSynchron(page, request, async);
			}
		});
		// webClient.setHTMLParserListener(new HTMLParserListener() {
		//
		// @Override
		// public void warning(String arg0, URL arg1, String arg2, int arg3, int arg4,
		// String arg5) {
		//
		// log.error("warning:" + arg0 + "|" + arg1 + "|" + arg2 + "|" + arg3 + "|" +
		// arg4 + "|" + arg5);
		// }
		//
		// @Override
		// public void error(String arg0, URL arg1, String arg2, int arg3, int arg4,
		// String arg5) {
		//
		// log.error("error:" + arg0 + "|" + arg1 + "|" + arg2 + "|" + arg3 + "|" + arg4
		// + "|" + arg5);
		//
		// }
		// });
		webClient.setStatusHandler(new StatusHandler() {

			@Override
			public void statusMessageChanged(Page page, String message) {

				log.info(page.getUrl() + "[statusMessageChanged]" + message);
			}
		});
//		webClient.getOptions().setScreenHeight(5000);//设置浏览器的高度
		webClient.getOptions().setTimeout(15 * 60 * 1000);// 设置“浏览器”的请求超时时间 15分钟
		webClient.getOptions().setMaxInMemory(768000);
		webClient.getOptions().setRedirectEnabled(true);
		webClient.getOptions().setThrowExceptionOnScriptError(false);// 当JS执行出错的时候是否抛出异常
		webClient.getOptions().setThrowExceptionOnFailingStatusCode(true);// 当HTTP的状态非200时是否抛出异常
		webClient.getOptions().setCssEnabled(true);// 是否启用CSS
		webClient.getOptions().setJavaScriptEnabled(true); // 很重要，启用JS
		webClient.setJavaScriptTimeout(100000);// 设置JS执行的超时时间
		webClient.waitForBackgroundJavaScript(10000);// 设置JS后台等待执行时间
		webClient.setAjaxController(new NicelyResynchronizingAjaxController());// 设置支持AJAX
		webClient.getOptions().setUseInsecureSSL(true);// SSL
		webClient.getCookieManager().setCookiesEnabled(true);
		scl = new SimpleConectionListener(webClient);
		
	}

	@Override
	public void preIndex() {

	}

	@Override
	public void index() {

	}

	/**
	 * 判断登录状态
	 * 
	 * @return
	 */
	@SuppressWarnings("unchecked")
	@Override
	public Map<String, Object> checkLogin() {
		Map<String, Object> map = new HashMap<String, Object>();
		try {
			CsairPage checkLogin = webClient.getCsairJsonObjectPage(URLChecklogin);
			
			if (checkLogin.getJsonObject().isEmpty()) {
				return null;
			}
			map = checkLogin.getJsonObject();
			return map;
		} catch (FailingHttpStatusCodeException e) {
			e.printStackTrace();
		} catch (MalformedURLException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}

	/**
	 *
	 * @author snailzhang
	 * @date 2017年8月8日
	 *
	 * @param returnValue
	 * @return
	 */
	private CsairReturnValue checkLoginReturnValue(CsairReturnValue returnValue) {
		Map<String, Object> map = checkLogin();
		if (map == null) {
			returnValue.setState(CS.FAIL);
			returnValue.setMessage("获取登录状态ao失败");
		}
		String success = String.valueOf(map.get("success"));
		log.info("登录成功状态:"+success);
		if (success.equals("true")) {
			returnValue.setState(CS.SUCCESS);
			returnValue.setMessage("登录成功");
			JSONObject jsonObject = (JSONObject) map.get("data");
			String userType = String.valueOf(jsonObject.get("userType"));
			String userName = String.valueOf(jsonObject.get("userName"));
			String identifyStatus = String.valueOf(jsonObject.get("identifyStatus"));
			returnValue.setUserType(userType);
			returnValue.setUserName(userName);
			returnValue.setIdentifyStatus(identifyStatus);
		} else {
			returnValue.setState(CS.FAIL);       
			returnValue.setMessage("登录失败");
		}
		return returnValue;
	}

	/**
	 * 用户监听加载页面的通用方法
	 *
	 * @author snailzhang
	 * @date 2017年7月25日
	 *
	 * @param page
	 * @param xpathExpr
	 */
	private CS loadPageHandler(CsairPage page, String xpathExpr) {
		log.info("====================loadPageHandler=========================");
		for (int i = 0; i <= timeoutmax; i++) {

			if (page.getHtmlPage() == null) {
				page.setPRE(CS.FAIL);
				log.info(page.getPRE());
				return CS.FAIL;
			}
//			log.info("------------------------------------------------------------------");
//			log.info(page.getHtmlPage().asXml());
//			log.info("------------------------------------------------------------------");
			Object obj = page.getHtmlPage().getFirstByXPath(xpathExpr);
			if (obj != null) {
				page.setPRE(CS.SUCCESS);
				log.info(page.getPRE());
				return CS.SUCCESS;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
					page.setPRE(CS.FAIL);
					page.getHtmlPage().cleanUp();
					log.info(page.getPRE());
					return CS.FAIL;
				}
				page.setPRE(CS.LOADING);
				log.info(page.getPRE());
			}
		}
		page.setPRE(CS.TIMEOUT);
		page.getHtmlPage().cleanUp();
		log.info(page.getPRE());
		return CS.TIMEOUT;
	}

	/**
	 * 统一click 事件
	 *
	 * @author snailzhang
	 * @date 2017年8月8日
	 *
	 * @param element
	 * @return
	 */
	private HtmlPage clickHandler(DomElement element) {
		try {
			HtmlPage p = element.click();
			return p;
		} catch (IOException e) {
			e.printStackTrace();
			log.error(element.asXml());
		}
		return null;
	}

	/**
	 * 预加载登录页
	 */
	@Override
	public void preLogin() {
		if (loginPage != null) {
			if ((CS.SUCCESS).equals(loginPage.getPRE())) {
				return;
			}
		}
		loginPage = webClient.getCsairHtmlPage(Csair.URLlogin, "URLlogin", true);
		loadPageHandler(loginPage, "//input[@id='userId']");

	}

	/**
	 * 登录
	 */
	@Override
	public CsairReturnValue login(String username, String password) {
//		log.info(username+"  "+password);
		CsairReturnValue returnValue = new CsairReturnValue();
		CS cs = loadPageHandler(loginPage, "//input[@id='userId']");
		if (CS.SUCCESS != cs) {
			preLogin();
		}
		HtmlPage page = loginPage.getHtmlPage();
//		log.info("********************************"+page.asXml());
		if (loginPage.getPRE().equals(CS.SUCCESS)) {// 加载完成
			HtmlForm form = page.getFirstByXPath("//form[@id='memberLogin']");
			loginPage.setParent(form);
			HtmlInput userId = form.getFirstByXPath("//input[@id='userId']");
			userId.setValueAttribute(username);
			HtmlPasswordInput passWord = form.getFirstByXPath("//input[@id='passWord']");
			passWord.setValueAttribute(password);
			HtmlInput loginProtocol = form.getFirstByXPath("//input[@id='loginProtocol']");
			clickHandler(loginProtocol);
			HtmlButton submit = (HtmlButton) form.getFirstByXPath("//button[@type='submit']");
			//log.info("********************************"+form.asXml());
			clickHandler(submit);
		}
		for (int i = 0; i < timeoutmax; i++) {
			if(scl.URLloginFunction != null){
				returnValue = checkLoginReturnValue(returnValue);
				return returnValue;
			}
			synchronized (page) {
				try {
					page.wait(800);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
			log.info("等待返回页面登录方法......");
		}
		returnValue = checkLoginReturnValue(returnValue);
		return returnValue;
	}

	/**
	 * 预加载手机号查询订单
	 */
	@Override
	public CS prePhone() {
		phonePage = webClient.getCsairHtmlPage(Csair.URLPhoneQueryOrder, "URLPhoneQueryOrder",false);
		CS cs = loadPageHandler(phonePage, "//form[@id='dynamicPswLogin']");
		return cs;
	}

	/**
	 * 手机查询订单发送验证码
	 */
	@Override
	public CsairReturnValue phoneQueryVerifCode(String mobileNum) {
		CsairReturnValue returnValue = new CsairReturnValue();
		CS cs = loadPageHandler(phonePage, "//form[@id='dynamicPswLogin']");
		if (CS.SUCCESS != cs) {
			prePhone();
		}
		HtmlPage page = phonePage.getHtmlPage();
		if (phonePage.getPRE().equals(CS.SUCCESS) && phonePage.isNull() == false) {
			DomElement tabdiv = page.getFirstByXPath("//li[@data-boxname='dynamicPswBox']");
			clickHandler(tabdiv);
			HtmlDivision div = page.getFirstByXPath("//div[@id='dynamicPswBox']");
			HtmlForm form = div.getFirstByXPath("//form[@id='dynamicPswLogin']");
			HtmlInput mobile = form.getFirstByXPath("//input[@id='eId']");
			page.setFocusedElement(mobile);
			mobile.setValueAttribute(mobileNum);
			mobile.type(9);// 回车
			HtmlDivision yzm = form.getFirstByXPath("//div[@id='dyn_btn_psw']");
			String yzmText = yzm.asText();
//			log.info("yzmText==>"+yzmText);
			if(yzmText.contains("再获取")){
				returnValue.setState(CS.SUCCESS);
				returnValue.setMessage("密码请在"+yzmText+",或使用已接收的验证码进行验证");
				return returnValue;
			}
			clickHandler(yzm);
			log.info("手机查询订单发送验证码，执行点击动作！");
			for (int i = 0; i < timeoutmax; i++) {
				if(scl.URLCheckYzm != null){
					returnValue.setState(CS.SUCCESS);
					returnValue.setMessage("已点击发送验证码按钮");
					return returnValue;
				}
				synchronized (page) {
					try {
						page.wait(200);
					} catch (InterruptedException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
					log.info("等待执行点击验证码......");
				}
			}

		}
		returnValue.setMessage("获取验证码失败，请重新点击获取！");
		return returnValue;
	}

	/**
	 * 手机查询订单
	 *
	 */
	@Override
	public CsairReturnValue phone(String username, String vcodeReg) {
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = phonePage.getHtmlPage();
		if (phonePage.getPRE().equals(CS.SUCCESS) && phonePage.isNull() == false) {
			HtmlForm form = page.getFirstByXPath("//form[@id='dynamicPswLogin']");
			phonePage.setParent(form);
			HtmlInput phoneInput = form.getFirstByXPath("//input[@id='eId']");
			phoneInput.setValueAttribute(username);
			HtmlInput vcodeRegInput = form.getFirstByXPath("//input[@id='vcode']");
			vcodeRegInput.setValueAttribute(vcodeReg);
			HtmlInput loginProtocol1= form.getFirstByXPath("//input[@id='loginProtocol1']");
			clickHandler(loginProtocol1);
			HtmlButton submitButton = form.getFirstByXPath("//button[@id='dyn_btn_login']");
			page = clickHandler(submitButton);
		}
	   //等待返回页面login方法
		for (int i = 0; i < timeoutmax; i++) {
			if(scl.URLloginFunction != null){
				try {
					Thread.sleep(1000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				returnValue = checkLoginReturnValue(returnValue);
				break;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
			log.info("等待返回页面动态登录方法......");
		}
		
		for (int i = 0; i < timeoutmax; i++) {
			if(returnValue.getState() == CS.SUCCESS){
				break;
			}
			returnValue = checkLoginReturnValue(returnValue);
			synchronized (page) {
				try {
					page.wait(800);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("等待动态登陆成功。。。。。。");
			}
			
		}
		return returnValue;
	}

	/**
	 * 预加载注册页
	 */
	@Override
	public void preRegister() {
		registerPage = webClient.getCsairHtmlPage(Csair.URLregister, "URLregister", false);
		loadPageHandler(registerPage, "//div[@id='a100']");
	}

	/**
	 * 注册返回方法
	 */
	@Override
	public CsairReturnValue registerAuthCode(String code) {
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = registerPage.getHtmlPage();
		HtmlDivision div = page.getFirstByXPath("//div[@id='joinMember']");
		registerPage.setParent(div);
		HtmlInput password = div.getFirstByXPath("//input[@id='authCode']");
		password.setAttribute("value", code);
		HtmlAnchor anchor = div.getFirstByXPath("//a[@class='menberbtn bind']");
		clickHandler(anchor);
		if (alertMessage != null) {
			returnValue.setMessage(alertMessage);
			returnValue.setState(CS.FAIL);
			log.info("注册返回方法状态："+returnValue.getState());
			alertMessage = null;
			return returnValue;
		}
		
		returnValue.setMessage("注册成功");
		returnValue.setState(CS.SUCCESS);
		return returnValue;
	}

	/**
	 * 注册验证码
	 */
	@Override
	public CsairReturnValue register(String username, String username1, String countryCode, String mobile,
			String ID_type, String ID_number, String email) {
		CsairReturnValue returnValue = new CsairReturnValue();
		CS cs = loadPageHandler(registerPage, "//div[@id='a100']");
		if (CS.SUCCESS != cs) {
			preRegister();
		}
		HtmlPage page = registerPage.getHtmlPage();
		HtmlDivision div = page.getFirstByXPath("//div[@id='a100']");
		registerPage.setParent(div);

		HtmlInput usernameInput = div.getFirstByXPath("//input[@id='pinyinzh1']");// 姓
		page.setFocusedElement(usernameInput);
		usernameInput.setAttribute("value", username);

		HtmlInput username1Input = div.getFirstByXPath("//input[@id='pinyinzh2']");// 名
		page.setFocusedElement(username1Input);
		username1Input.setAttribute("value", username1);

		HtmlSelect ID_typeSelect = div.getFirstByXPath("//select[@id='certType']");// 证件类型
		ID_typeSelect.getOptionByText(ID_type);

		HtmlInput ID_numberInput = div.getFirstByXPath("//input[@id='certNum3']");
		page.setFocusedElement(ID_numberInput);// 身份证
		ID_numberInput.setAttribute("value", ID_number);
		ID_numberInput.blur();

		HtmlSelect countryCodeSelect = div.getFirstByXPath("//select[@id='countryCodes']");
		page.setFocusedElement(countryCodeSelect);
		HtmlOption htmlOption = countryCodeSelect.getOptionByText(countryCode);
		htmlOption.setSelected(true);
		htmlOption.type(9);

		HtmlInput mobilInput = div.getFirstByXPath("//input[@id='certNum']");
		mobilInput.setAttribute("value", mobile);// 手机号
		mobilInput.blur();

		HtmlInput emailInput = div.getFirstByXPath("//input[@id='certNum2']");
		page.setFocusedElement(emailInput);// 邮箱
		emailInput.setAttribute("value", email);
		emailInput.type(9);

		HtmlCheckBoxInput policyCheck = div.getFirstByXPath("//input[@id='policy']");
		page.setFocusedElement(policyCheck);// 条款
		policyCheck.setChecked(true);
		// 获得一个误操作的input 在点击入会前转移一下交点
		HtmlInput xp = div.getFirstByXPath("//input[@id='certNum8']");
		page.setFocusedElement(xp);
		HtmlAnchor anchor = div.getFirstByXPath("//a[@id='menberbtn']");
		clickHandler(anchor);
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		HtmlSpan erroSpan1 = page.getFirstByXPath("//span[@id='errorinfo']");
		HtmlSpan erroSpan2 = page.getFirstByXPath("//span[@id='errorinfo2']");
		HtmlSpan erroSpan4 = page.getFirstByXPath("//span[@id='errorinfo4']");
		if (erroSpan1.getAttribute("style").contains("display: inline")) {
			returnValue.setState(CS.FAIL);
			returnValue.setMessage(erroSpan1.asText());
			log.info("erroSpan1.asText()==>" + erroSpan1.asText());
			return returnValue;
		}
		if (erroSpan2.getAttribute("style").contains("display: inline")) {
			returnValue.setState(CS.FAIL);
			returnValue.setMessage(erroSpan2.asText());
			log.info("erroSpan2.asText()==>" + erroSpan2.asText());
			return returnValue;
		}
		if (erroSpan4.getAttribute("style").contains("display: inline")) {
			returnValue.setState(CS.FAIL);
			returnValue.setMessage(erroSpan4.asText());
			log.info("erroSpan4.asText()==>" + erroSpan4.asText());
			return returnValue;
		}
		if (alertMessage != null && alertMessage.contains("生日")) {
			returnValue.setState(CS.FAIL);
			returnValue.setMessage("身份证输入有误!");
			log.info("alertMessage===>" + alertMessage);
			alertMessage = null;
			return returnValue;
		}
		if (alertMessage != null) {
			returnValue.setState(CS.FAIL);
			returnValue.setMessage(alertMessage);
			log.info("alertMessage===>" + alertMessage);
			alertMessage = null;
			return returnValue;
		}
		returnValue.setState(CS.SUCCESS);
		log.info("未出现异常!");
		return returnValue;
	}

	/**
	 * 预加载找回密码页
	 */
	@Override
	public void preForgotPassword() {
		forgotPasswordPage = webClient.getCsairHtmlPage(Csair.URLfindpassword, "URLfindpassword", true);
		loadPageHandler(forgotPasswordPage, "//form[@id='dynamicPswLogin']");
	}

	/**
	 * 点击获取找回密码
	 */
	@Override
	public CsairReturnValue forgotPassword(String username) {
		CsairReturnValue returnValue = new CsairReturnValue();
		CS cs = loadPageHandler(forgotPasswordPage, "//form[@id='dynamicPswLogin']");
		if (CS.SUCCESS != cs) {
			preForgotPassword();
		}
		HtmlPage page = forgotPasswordPage.getHtmlPage();
		if (forgotPasswordPage.getPRE().equals(CS.SUCCESS) && forgotPasswordPage.isNull() == false) {
			HtmlElement hp = (HtmlElement) page.getFirstByXPath("//li[@class='left psw-login']");
			clickHandler(hp);
			HtmlDivision div = (HtmlDivision) page.getFirstByXPath("//div[@id='dynamicPswBox']");
			HtmlForm form = (HtmlForm) div.getFirstByXPath("//form[@id='dynamicPswLogin']");
			HtmlInput mobile = (HtmlInput) form.getFirstByXPath("//input[@id='mobile']");
			page.setFocusedElement(mobile);
			mobile.setValueAttribute(username);
			mobile.type(13);// 回车
			HtmlDivision yzm = (HtmlDivision) form.getFirstByXPath("//div[@id='dyn_btn_psw']");
			clickHandler(yzm);
			returnValue.setState(CS.SUCCESS);
			returnValue.setMessage("点击发送信息!");
		} else if (forgotPasswordPage.getPRE().equals(CS.TIMEOUT)) {// 加载超时
			returnValue.setState(CS.TIMEOUT);
			returnValue.setMessage("请求超时");
		} else if (forgotPasswordPage.getPRE().equals(CS.FAIL)) {// 加载超时
			returnValue.setState(CS.TIMEOUT);
			returnValue.setMessage("请求失败");
		}
		return returnValue;
	}

	/**
	 * 忘记密码登录
	 */
	@Override
	public CsairReturnValue forgotPasswordLogin(String username, String password) {
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = forgotPasswordPage.getHtmlPage();
		if (forgotPasswordPage.getPRE().equals(CS.SUCCESS) && forgotPasswordPage.isNull() == false) {
			HtmlForm form = (HtmlForm) page.getByXPath("//form[@id='dynamicPswLogin']").get(0);
			forgotPasswordPage.setParent(form);
			HtmlInput phoneInput = (HtmlInput) form.getByXPath("//input[@id='mobile']").get(0);
			phoneInput.setValueAttribute(username);
			HtmlInput vcodeRegInput = (HtmlInput) form.getByXPath("//input[@id='vcode']").get(0);
			vcodeRegInput.setValueAttribute(password);
			HtmlButton submitButton = (HtmlButton) form.getByXPath("//button[@id='dyn_btn_login']").get(0);
			page = clickHandler(submitButton);
		}
		try {
			Thread.sleep(500);
		} catch (InterruptedException e2) {
			e2.printStackTrace();
		}
		returnValue = checkLoginReturnValue(returnValue);
		return returnValue;
	}

	/**
	 * 预加载修改密码页
	 */
	@Override
	public void preModifyPassword() {
		modifyPasswordPageSrc = webClient.getCsairHtmlPage(Csair.URLModifyPassword, "URLModifyPassword", false);
		loadPageHandler(modifyPasswordPageSrc, "//div[@id='searchbox']");
	}

	/**
	 * 修改密码
	 */
	@Override
	public CsairReturnValue modifyPassword(String oldpassword, String newpassword, String newpasswordagain) {
		CsairReturnValue returnValue = new CsairReturnValue();
		CS cs = loadPageHandler(modifyPasswordPageSrc, "//div[@id='searchbox']");
		if (CS.SUCCESS != cs) {
			preModifyPassword();
		}
		HtmlPage pageSrc = modifyPasswordPageSrc.getHtmlPage();
		if (modifyPasswordPageSrc.getPRE().equals(CS.SUCCESS) && modifyPasswordPageSrc.isNull() == false)

		{
			HtmlDivision div = (HtmlDivision) pageSrc.getByXPath("//div[@class='alist']").get(0);
//			log.info("div==>" + div.asXml());
			modifyPasswordPageSrc.setParent(div);

			HtmlInput oldpasswordInput = (HtmlInput) div.getFirstByXPath("//input[@id='oldPassword']");
//			log.info("oldpasswordInput==>" + oldpasswordInput.asXml());
			oldpasswordInput.setAttribute("value", oldpassword);

			HtmlInput newpasswordInput = (HtmlInput) div.getFirstByXPath("//input[@id='newPassword']");
//			log.info("newpasswordInput==>" + newpasswordInput.asXml());
			newpasswordInput.setAttribute("value", newpassword);

			HtmlInput newpasswordagainInput = (HtmlInput) div.getFirstByXPath("//input[@id='newPassword2']");
//			log.info("newpasswordagainInput==>" + newpasswordagainInput.asXml());
			newpasswordagainInput.setAttribute("value", newpasswordagain);
			HtmlElement submitButton = (HtmlElement) div.getFirstByXPath("//input[@id='updatePwd']");
			clickHandler(submitButton);
			for (int i = 0; i < timeoutmax; i++) {
				if(scl.URLModifyPasswordcheck != null){
					try {
						Thread.sleep(1000);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
					HtmlSpan oldPasswordMsg = div.getFirstByXPath("//span[@id='oldPasswordMsg']");
					HtmlSpan newPasswordMsg = div.getFirstByXPath("//span[@id='newPasswordMsg']");
					HtmlSpan newPassword2Msg = div.getFirstByXPath("//span[@id='newPassword2Msg']");
					if (oldPasswordMsg.getAttribute("style").contains("display: inline")) {
						returnValue.setMessage(oldPasswordMsg.asText());
						returnValue.setState(CS.FAIL);
//						log.info(oldPasswordMsg.asText());
						return returnValue;
					} else if (newPasswordMsg.getAttribute("style").contains("display: inline")) {
						returnValue.setMessage(newPasswordMsg.asText());
						returnValue.setState(CS.FAIL);
//						log.info(newPasswordMsg.asText());
						return returnValue;
					} else if (newPassword2Msg.getAttribute("style").contains("display: inline")) {
						returnValue.setMessage(newPassword2Msg.asText());
						returnValue.setState(CS.FAIL);
//						log.info(newPassword2Msg.asText());
						return returnValue;
					} else if(alertMessage != null && alertMessage.contains("成功")){
						returnValue.setState(CS.SUCCESS);
						returnValue.setMessage(alertMessage);
						log.info("修改密码成功");
						return returnValue;
					} else {
						returnValue.setState(CS.FAIL);
						returnValue.setMessage("修改密码失败");
						log.info("修改密码失败");
						return returnValue;
					}
				}
				synchronized (pageSrc) {
					try {
						pageSrc.wait(500);
					} catch (InterruptedException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
					log.info("正在判断修改密码是否成功.......");
				}
			}

			
		} else if (modifyPasswordPageSrc.getLS().equals(CS.TIMEOUT)) {
			preModifyPassword();
			modifyPasswordPageSrc.setLS(CS.REPEAT);
			modifyPassword(oldpassword, newpassword, newpasswordagain);
		} else if (modifyPasswordPageSrc.getLS().equals(CS.FAIL)) {
			preModifyPassword();
			modifyPasswordPageSrc.setLS(CS.REPEAT);
			modifyPassword(oldpassword, newpassword, newpasswordagain);
		} else if (modifyPasswordPageSrc.getLS().equals(CS.REPEAT)) {
			modifyPasswordPageSrc.setLS(CS.FAIL);
			returnValue.setMessage("访问失败");
			return returnValue;
		}
		synchronized (pageSrc) {
			try {
				pageSrc.wait(200);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			log.info("页面加载完成后modifyPasswordPage.getLS()===>" + modifyPasswordPageSrc.getLS());

		}
		return returnValue;
	}

	

	/**
	 * 新订单查询
	 */
	@Override
	public JSONObject queryPlaneOrders(String pageNum) {
		scl.URLorderCN = null;
		try {
			String QueryPlaneOrdersAO = Csair.URQueryPlaneOrdersAo + "&page=" + pageNum;
			log.info("开始汉字化行程!!!!!");
			for (int i = 0; i < 5; i++) {
				if(scl.URLorderCN != null || scl.URLorderCN2 != null){
					CsairPage page = webClient.getCsairJsonObjectPage(QueryPlaneOrdersAO);
					JSONObject a = page.getJsonObject();
					return a;
				}
				synchronized (QueryPlaneOrdersAO) {
					try {
						QueryPlaneOrdersAO.wait(1000);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
					log.info("订单列表处理中......");
				}
			}
			CsairPage page = webClient.getCsairJsonObjectPage(QueryPlaneOrdersAO);
			JSONObject a = page.getJsonObject();
			return a;
		} catch (FailingHttpStatusCodeException | IOException e) {
			e.printStackTrace();
		}
		return null;
	}
	
	/**
	 * 跳转支付时订单查询
	 */
	@Override
	public JSONObject queryPlaneOrders1() {
		try {
			String QueryPlaneOrdersAO = Csair.URQueryPlaneOrdersAo;
			CsairPage page = webClient.getCsairJsonObjectPage(QueryPlaneOrdersAO);
			JSONObject a = page.getJsonObject();
			return a;
		} catch (FailingHttpStatusCodeException | IOException e) {
			e.printStackTrace();
		}
		return null;
	}
	
	/**
	 * 订单详情
	 */
	@Override
	public Map<String , Object> OrderMX(String orderNum) {
		Map<String , Object> map  = new HashMap<String, Object>();
		String URLOrderMx = Csair.URLOrderMX + orderNum;
		CsairPage orderMxPage = webClient.getCsairHtmlPage(URLOrderMx, "URLOrderMx", false);
		for (int i = 0; i <= timeoutmax; i++) {
			if (orderMxPage.getHtmlPage() == null) {
				orderMxPage.setPRE(CS.FAIL);
				log.info(orderMxPage.getPRE());
			}
			if(scl.URLOrderMXError != null){
				log.info("URLOrderMXError1==>"+scl.URLOrderMXError);
				scl.URLOrderMXError = null;
				log.info("URLOrderMXError2==>"+scl.URLOrderMXError);
				return OrderMX(orderNum);
			}
			HtmlPage page = orderMxPage.getHtmlPage();
			List<HtmlElement> obj = page.getBody().getElementsByAttribute("div", "class", "table-item");
			if (obj.size() != 0) {
				orderMxPage.setPRE(CS.SUCCESS);
				log.info("=================="+orderMxPage.getPRE());
			
				String statusStr = page.getElementById("statusStr").asText();//订单状态
	//			log.info("statusStr====>"+statusStr);
				String orderNo = page.getElementById("orderNo").asText();//订单号
	//			log.info("orderNo==>"+orderNo);
				String totalPrice = page.getElementById("totalPrice").asText();//总价
	//			log.info("totalPrice==>"+totalPrice);
				map.put("statusStr", statusStr);
				map.put("orderNo", orderNo);
				map.put("totalPrice", totalPrice);
				
				List<OrderMXFlihgtInfo> orderMXFlihgtInfoList = new ArrayList<OrderMXFlihgtInfo>();
				HtmlDivision flightInfo = (HtmlDivision) page.getElementById("flightInfo");//航班信息div
				Document flightInfoDoc = Jsoup.parse(flightInfo.asXml());
				Elements flightInfoElements = flightInfoDoc.select("div.table-item");
				for (Iterator iterator = flightInfoElements.iterator(); iterator.hasNext();) {
					OrderMXFlihgtInfo orderMXFlihgtInfo = new OrderMXFlihgtInfo();
					Element flightInfoElement = (Element) iterator.next();
					Elements flightInfoMXs = flightInfoElement.select("span.table-td");
					orderMXFlihgtInfo.setStroke(flightInfoMXs.get(0).text());//行程
					orderMXFlihgtInfo.setFlightNo(flightInfoMXs.get(1).text());//航班号
					orderMXFlihgtInfo.setBerth(flightInfoMXs.get(2).text());//舱位
					orderMXFlihgtInfo.setType(flightInfoMXs.get(3).text());//机型
					orderMXFlihgtInfo.setDate(flightInfoMXs.get(4).text());//日期
					orderMXFlihgtInfo.setSendTime(flightInfoMXs.get(5).text());//出发时间
					orderMXFlihgtInfo.setArrTime(flightInfoMXs.get(6).text());//到达时间
	//				log.info("arrtime===>"+orderMXFlihgtInfo.getArrTime());
					orderMXFlihgtInfoList.add(orderMXFlihgtInfo);
				}
				map.put("orderMXFlihgtInfoList", orderMXFlihgtInfoList);
				
				List<OrderMXPriceInfo> orderMXPriceInfoList = new ArrayList<OrderMXPriceInfo>();
				HtmlDivision priceInfo = (HtmlDivision) page.getElementById("priceInfo");//票价信息
				Document priceInfoDoc = Jsoup.parse(priceInfo.asXml());
				Elements priceInfoElements = priceInfoDoc.select("div.table-item");
				for (Iterator iterator = priceInfoElements.iterator(); iterator.hasNext();) {
					OrderMXPriceInfo orderMXPriceInfo = new OrderMXPriceInfo();
					Element priceInfoElement = (Element) iterator.next();
					Elements priceInfoMXs = priceInfoElement.select("span.table-td");
					orderMXPriceInfo.setpType(priceInfoMXs.get(0).text());//乘客类型
					orderMXPriceInfo.setPrice(priceInfoMXs.get(1).text());//票价
					orderMXPriceInfo.setTax(priceInfoMXs.get(2).text());//机场税
					orderMXPriceInfo.setFuelCost(priceInfoMXs.get(3).text());//燃油费
					orderMXPriceInfo.setpTotlePrice(priceInfoMXs.get(4).text());//每位乘客总价
					orderMXPriceInfo.setpCount(priceInfoMXs.get(5).text());//人数
					orderMXPriceInfo.setInsurancePremium(priceInfoMXs.get(6).text());//保险费
					orderMXPriceInfo.setTotle(priceInfoMXs.get(7).text());//合计
	//				log.info("totle===>"+orderMXPriceInfo.getTotle());
					orderMXPriceInfoList.add(orderMXPriceInfo);
				}
				map.put("orderMXPriceInfoList", orderMXPriceInfoList);
				
				List<OrderMXPassengerInfo> orderMXPassengerInfoList = new ArrayList<OrderMXPassengerInfo>();
				HtmlDivision psgInfo = (HtmlDivision) page.getElementById("psgInfo");
				Document psgInfoDoc = Jsoup.parse(psgInfo.asXml());
				Elements psgInfoElements = psgInfoDoc.select("div.table-item");
				for (Iterator iterator = psgInfoElements.iterator(); iterator.hasNext();) {
					OrderMXPassengerInfo  orderMXPassengerInfo = new OrderMXPassengerInfo();
					Element psgInfoElement = (Element) iterator.next();
					Elements psgInfoMXs = psgInfoElement.select("span.table-td");
					orderMXPassengerInfo.setIndex(psgInfoMXs.get(0).text());//序号
					orderMXPassengerInfo.setName(psgInfoMXs.get(1).text());//乘客姓名
					orderMXPassengerInfo.setpType(psgInfoMXs.get(2).text());//乘客类型
					orderMXPassengerInfo.setCardType(psgInfoMXs.get(3).text());//证件类型
					orderMXPassengerInfo.setCardNo(psgInfoMXs.get(4).text());//证件号
					orderMXPassengerInfo.setCkCardNo(psgInfoMXs.get(5).text());//常客卡号
					orderMXPassengerInfo.setKpNo(psgInfoMXs.get(6).text());//客票号
					orderMXPassengerInfoList.add(orderMXPassengerInfo);
				}
				map.put("orderMXPassengerInfoList", orderMXPassengerInfoList);
				
				List<OrderMXContactInfo> orderMXContactInfoInfoList = new ArrayList<OrderMXContactInfo>();
				HtmlDivision contactInfo = (HtmlDivision) page.getElementById("contactInfo");
				Document contactInfoDoc = Jsoup.parse(contactInfo.asXml());
				Elements contactInfoElements = contactInfoDoc.select("div.table-item");
				Element contactInfoElement = contactInfoElements.get(0);
				OrderMXContactInfo orderMXContactInfo = new OrderMXContactInfo();
				Elements contactInfoMXs = contactInfoElement.select("span.table-td");
				orderMXContactInfo.setName(contactInfoMXs.get(0).text());//姓名
				orderMXContactInfo.setTelphone(contactInfoMXs.get(1).text());//电话
				orderMXContactInfo.setMobile(contactInfoMXs.get(2).text());//手机
				orderMXContactInfo.setEmail(contactInfoMXs.get(3).text());//邮箱
				orderMXContactInfoInfoList.add(orderMXContactInfo);
				map.put("orderMXContactInfoInfoList", orderMXContactInfoInfoList);
				return map;
			}
			synchronized (orderMxPage) {
				try {
					orderMxPage.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
					orderMxPage.setPRE(CS.FAIL);
					orderMxPage.getHtmlPage().cleanUp();
					log.info(orderMxPage.getPRE());
				}
				orderMxPage.setPRE(CS.LOADING);
				log.info(orderMxPage.getPRE());
			}
		}
		orderMxPage.setPRE(CS.FAIL);
		orderMxPage.setPRE(CS.TIMEOUT);
		log.info(orderMxPage.getPRE());
		return map;
	}

	/**
	 * 变更单详情
	 */
	@Override
	public Map<String, Object> changeListMX(String orderno, String changeno, String changetype) {
		Map<String , Object> map  = new HashMap<String, Object>();
		String URLchangeListMX = Csair.URLchangeListMX + "?orderno="+orderno+"&changeno="+changeno+"&changetype="+changetype;
		CsairPage changeListMxPage = webClient.getCsairHtmlPage(URLchangeListMX, "URLchangeListMX", false);
		for (int i = 0; i <= timeoutmax; i++) {
			if (changeListMxPage.getHtmlPage() == null) {
				changeListMxPage.setPRE(CS.FAIL);
				log.info(changeListMxPage.getPRE());
			}
			if(scl.URLOrderMXError != null){
				log.info("URLOrderMXError1==>"+scl.URLOrderMXError);
				scl.URLOrderMXError = null;
				log.info("URLOrderMXError2==>"+scl.URLOrderMXError);
				return changeListMX(orderno,changeno,changetype);
			}
			HtmlPage page = changeListMxPage.getHtmlPage();
			List<HtmlElement> totalDivs = page.getBody().getElementsByAttribute("div", "class", "total");
			if (totalDivs.size() != 0) {
				HtmlDivision totalDiv = (HtmlDivision) totalDivs.get(0);
				HtmlSpan totalDivSpan = (HtmlSpan) totalDiv.getElementsByTagName("span").get(0);
				if(totalDivSpan.asText().trim() != "") {
					map.put("totalPrice", totalDivSpan.asText());
					
					HtmlSpan changestatusSpan = (HtmlSpan) page.getElementById("changestatus");
					map.put("changestatus", changestatusSpan.asText());
					
					HtmlSpan tit01Span = (HtmlSpan) page.getBody().getElementsByAttribute("span", "class", "tit01").get(0);
					map.put("changeNo", tit01Span.asText());
					
					HtmlSpan subtimeSpan = (HtmlSpan) page.getBody().getElementsByAttribute("span", "class", "subtime").get(0);
					map.put("subtime", subtimeSpan.asText());
					
					HtmlDivision messTabDiv0 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "messTab").get(0);
					DomNodeList<HtmlElement> messTabDiv0Trs = messTabDiv0.getElementsByTagName("tr");
					List<ChangeListMXFlightInfo> changeListMXFlightInfoListBefore = new ArrayList<ChangeListMXFlightInfo>();
					for (int j = 1; j < messTabDiv0Trs.size(); j++) {
						ChangeListMXFlightInfo changeListMXFlightInfo = new ChangeListMXFlightInfo();
						HtmlElement messTabDiv0Tr = messTabDiv0Trs.get(j);
						DomNodeList<HtmlElement> messTabDiv0TrTds = messTabDiv0Tr.getElementsByTagName("td");
						changeListMXFlightInfo.setHangBanHao(messTabDiv0TrTds.get(0).asText());
						changeListMXFlightInfo.setCangWei(messTabDiv0TrTds.get(1).asText());
						changeListMXFlightInfo.setJiXing(messTabDiv0TrTds.get(2).asText());
						changeListMXFlightInfo.setDate(messTabDiv0TrTds.get(3).asText());
						changeListMXFlightInfo.setChuFa(messTabDiv0TrTds.get(4).asText());
						changeListMXFlightInfo.setDiDa(messTabDiv0TrTds.get(5).asText());
						changeListMXFlightInfoListBefore.add(changeListMXFlightInfo);
					}
					map.put("changeListMXFlightInfoListBefore", changeListMXFlightInfoListBefore);
					
					HtmlDivision messTabDiv1 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "messTab").get(1);
					DomNodeList<HtmlElement> messTabDiv1Trs = messTabDiv1.getElementsByTagName("tr");
					List<ChangeListMXFlightInfo> changeListMXFlightInfoListAfter = new ArrayList<ChangeListMXFlightInfo>();
					for (int j = 1; j < messTabDiv1Trs.size(); j++) {
						ChangeListMXFlightInfo changeListMXFlightInfo = new ChangeListMXFlightInfo();
						HtmlElement messTabDiv1Tr = messTabDiv1Trs.get(j);
						DomNodeList<HtmlElement> messTabDiv1TrTds = messTabDiv1Tr.getElementsByTagName("td");
						changeListMXFlightInfo.setHangBanHao(messTabDiv1TrTds.get(0).asText());
						changeListMXFlightInfo.setCangWei(messTabDiv1TrTds.get(1).asText());
						changeListMXFlightInfo.setJiXing(messTabDiv1TrTds.get(2).asText());
						changeListMXFlightInfo.setDate(messTabDiv1TrTds.get(3).asText());
						changeListMXFlightInfo.setChuFa(messTabDiv1TrTds.get(4).asText());
						changeListMXFlightInfo.setDiDa(messTabDiv1TrTds.get(5).asText());
						changeListMXFlightInfoListAfter.add(changeListMXFlightInfo);
					}
					map.put("changeListMXFlightInfoListAfter", changeListMXFlightInfoListAfter);
					
					HtmlDivision messTabDiv2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "messTab").get(2);
					DomNodeList<HtmlElement> messTabDiv2Trs = messTabDiv2.getElementsByTagName("tr");
					List<ChangeListMXPassengerInfo> changeListMXPassengerInfoList = new ArrayList<ChangeListMXPassengerInfo>();
					for (int j = 1; j < messTabDiv2Trs.size(); j++) {
						ChangeListMXPassengerInfo changeListMXPassengerInfo = new ChangeListMXPassengerInfo();
						HtmlElement messTabDiv2Tr = messTabDiv2Trs.get(j);
						DomNodeList<HtmlElement> messTabDiv2TrTds = messTabDiv2Tr.getElementsByTagName("td");
						changeListMXPassengerInfo.setXuHao(messTabDiv2TrTds.get(0).asText());
						changeListMXPassengerInfo.setName(messTabDiv2TrTds.get(1).asText());
						changeListMXPassengerInfo.setpType(messTabDiv2TrTds.get(2).asText());
						changeListMXPassengerInfo.setcType(messTabDiv2TrTds.get(3).asText());
						changeListMXPassengerInfo.setcNum(messTabDiv2TrTds.get(4).asText());
						changeListMXPassengerInfo.setKePiaoHaoBefore(messTabDiv2TrTds.get(5).asText());
						changeListMXPassengerInfo.setKePiaoHaoAfter(messTabDiv2TrTds.get(6).asText());
						changeListMXPassengerInfoList.add(changeListMXPassengerInfo);
					}
					map.put("changeListMXPassengerInfoList", changeListMXPassengerInfoList);
					
					HtmlDivision messTabDiv3 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "messTab").get(3);
					DomNodeList<HtmlElement> messTabDiv3Trs = messTabDiv3.getElementsByTagName("tr");
					List<ChangeListMXPriceInfo> changeListMXPriceInfoList = new ArrayList<ChangeListMXPriceInfo>();
					for (int j = 1; j < messTabDiv3Trs.size(); j++) {
						ChangeListMXPriceInfo changeListMXPriceInfo = new ChangeListMXPriceInfo();
						HtmlElement messTabDiv3Tr = messTabDiv3Trs.get(j);
						DomNodeList<HtmlElement> messTabDiv3TrTds = messTabDiv3Tr.getElementsByTagName("td");
						changeListMXPriceInfo.setpType(messTabDiv3TrTds.get(0).asText());
						changeListMXPriceInfo.setChangePay(messTabDiv3TrTds.get(1).asText());
						changeListMXPriceInfo.setShengCangPay(messTabDiv3TrTds.get(2).asText());
						changeListMXPriceInfo.setRanYouFeiChaJia(messTabDiv3TrTds.get(3).asText());
						changeListMXPriceInfo.setJiChangShuiChaJia(messTabDiv3TrTds.get(4).asText());
						changeListMXPriceInfo.setCount(messTabDiv3TrTds.get(5).asText());
						changeListMXPriceInfo.setTotal(messTabDiv3TrTds.get(6).asText());
						changeListMXPriceInfoList.add(changeListMXPriceInfo);
					}
					map.put("changeListMXPriceInfoList", changeListMXPriceInfoList);
					
					return map;
				}
			}
			synchronized (changeListMxPage) {
				try {
					changeListMxPage.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
					changeListMxPage.setPRE(CS.FAIL);
					changeListMxPage.getHtmlPage().cleanUp();
					log.info(changeListMxPage.getPRE());
				}
				changeListMxPage.setPRE(CS.LOADING);
				log.info(changeListMxPage.getPRE());
			}
		}
		changeListMxPage.setPRE(CS.FAIL);
		changeListMxPage.setPRE(CS.TIMEOUT);
		log.info(changeListMxPage.getPRE());
		return map;
	}

	
	/**
	 * 退票单详情
	 */
	@Override
	public Map<String, Object> refundListMX(String refundno, String status) {
		Map<String , Object> map  = new HashMap<String, Object>();
		String URLrefundListMX = Csair.URLrefundListMX + "?refundno="+refundno+"&status="+status;
		CsairPage refundListMXPage = webClient.getCsairHtmlPage(URLrefundListMX, "URLrefundListMX", false);
		for (int i = 0; i <= timeoutmax; i++) {
			if (refundListMXPage.getHtmlPage() == null) {
				refundListMXPage.setPRE(CS.FAIL);
				log.info(refundListMXPage.getPRE());
			}
			if(scl.URLOrderMXError != null){
				log.info("URLOrderMXError1==>"+scl.URLOrderMXError);
				scl.URLOrderMXError = null;
				log.info("URLOrderMXError2==>"+scl.URLOrderMXError);
				return refundListMX(refundno,status);
			}
			HtmlPage page = refundListMXPage.getHtmlPage();
			HtmlSpan totalrepaymoneySpan = (HtmlSpan) page.getElementById("totalrepaymoney");
			if (totalrepaymoneySpan != null) {
				if(totalrepaymoneySpan.asText().trim() != "") {
					map.put("totalrepaymoney", totalrepaymoneySpan.asText());
					
					HtmlSpan totalchargeSpan = (HtmlSpan) page.getElementById("totalcharge");
					map.put("totalcharge", totalchargeSpan.asText());
					
					HtmlSpan statusSpan = (HtmlSpan) page.getElementById("status");
					map.put("refundStatus", statusSpan.asText());
					
					HtmlDivision tit01Div = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "tit01").get(0);
					map.put("refundNo", tit01Div.asText());
					
					HtmlDivision subtimeDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "subtime").get(0);
					map.put("subtime", subtimeDiv.asText());
					
					HtmlDivision sytjDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "prompt sytj").get(0);
					map.put("sytj", sytjDiv.asText());
					
					List<HtmlElement> pxboDivs = page.getBody().getElementsByAttribute("div", "class", "pxbo");
					HtmlDivision pxboDiv0 = (HtmlDivision) pxboDivs.get(0);
					DomNodeList<HtmlElement> pxboDiv0Trs = pxboDiv0.getElementsByTagName("tr");
					List<RefundMXFlightInfo> refundMXFlightInfoList = new ArrayList<RefundMXFlightInfo>();
					for (int j = 0; j < (pxboDiv0Trs.size()-1)/2; j++) {
						RefundMXFlightInfo refundMXFlightInfo = new RefundMXFlightInfo();
						HtmlElement pxboDiv0Tr = pxboDiv0Trs.get(j*2+1);
						DomNodeList<HtmlElement> pxboDiv0TrTds = pxboDiv0Tr.getElementsByTagName("td");
						refundMXFlightInfo.setHangCheng(pxboDiv0TrTds.get(0).asText());
						refundMXFlightInfo.setHangDuan(pxboDiv0TrTds.get(1).asText());
						refundMXFlightInfo.setHangBanHao(pxboDiv0TrTds.get(2).asText());
						refundMXFlightInfo.setCangWei(pxboDiv0TrTds.get(3).asText());
						refundMXFlightInfo.setJiXing(pxboDiv0TrTds.get(4).asText());
						refundMXFlightInfo.setDate(pxboDiv0TrTds.get(5).asText());
						refundMXFlightInfo.setChuFa(pxboDiv0TrTds.get(6).asText());
						refundMXFlightInfo.setDiDa(pxboDiv0TrTds.get(7).asText());
						refundMXFlightInfo.setRefunderName(pxboDiv0TrTds.get(8).getTextContent());
						refundMXFlightInfoList.add(refundMXFlightInfo);
					}
					map.put("refundMXFlightInfoList", refundMXFlightInfoList);
					
					HtmlDivision pxboDiv1 = (HtmlDivision) pxboDivs.get(1);
					DomNodeList<HtmlElement> pxboDiv1Trs = pxboDiv1.getElementsByTagName("tr");
					List<RefundMXContactWay> refundMXContactWayList = new ArrayList<RefundMXContactWay>();
					for (int j = 1; j < pxboDiv1Trs.size(); j++) {
						RefundMXContactWay refundMXContactWay = new RefundMXContactWay();
						HtmlElement pxboDiv1Tr = pxboDiv1Trs.get(j);
//						log.info(pxboDiv1Tr.asXml());
						DomNodeList<HtmlElement> pxboDiv1TrTds = pxboDiv1Tr.getElementsByTagName("td");
						log.info(pxboDiv1TrTds.get(0).asText());
						log.info(pxboDiv1TrTds.get(1).asText());
						refundMXContactWay.setXuHao(pxboDiv1TrTds.get(0).getTextContent());
						refundMXContactWay.setName(pxboDiv1TrTds.get(1).asText());
						refundMXContactWay.setTel(pxboDiv1TrTds.get(2).asText());
						refundMXContactWay.setPhone(pxboDiv1TrTds.get(3).asText());
						refundMXContactWay.setEmail(pxboDiv1TrTds.get(4).asText());
						refundMXContactWayList.add(refundMXContactWay);
					}
					map.put("refundMXContactWayList", refundMXContactWayList);
					
					List<RefundMXPayInfoSet> refundMXPayInfoSetList = new ArrayList<RefundMXPayInfoSet>();
					for (int j = 2; j < pxboDivs.size(); j++) {
						RefundMXPayInfoSet refundMXPayInfoSet = new RefundMXPayInfoSet();
						List<RefundMXPayInfo> refundMXPayInfoList = new ArrayList<RefundMXPayInfo>();
						HtmlDivision pxboDivJ = (HtmlDivision) pxboDivs.get(j);
						String hangCheng = pxboDivJ.getElementsByTagName("h5").get(0).asText();
						refundMXPayInfoSet.setHangCheng(hangCheng);
						DomNodeList<HtmlElement> pxboDivJTrs = pxboDivJ.getElementsByTagName("tr");
						for (int k = 1; k < pxboDivJTrs.size(); k++) {
							RefundMXPayInfo refundMXPayInfo = new RefundMXPayInfo();
							HtmlElement pxboDivJTr = pxboDivJTrs.get(k);
							DomNodeList<HtmlElement> pxboDivJTrTds = pxboDivJTr.getElementsByTagName("td");
							refundMXPayInfo.setName(pxboDivJTrTds.get(0).asText());
							refundMXPayInfo.setpType(pxboDivJTrTds.get(1).asText());
							refundMXPayInfo.setKePiaoNo(pxboDivJTrTds.get(2).asText());
							refundMXPayInfo.setBaoXianFei(pxboDivJTrTds.get(3).asText());
							refundMXPayInfo.setYuZhongXingLiFei(pxboDivJTrTds.get(4).asText());
							refundMXPayInfo.setRanYouFei(pxboDivJTrTds.get(5).asText());
							refundMXPayInfo.setJiChangShui(pxboDivJTrTds.get(6).asText());
							refundMXPayInfo.setDanZhangPiaoJia(pxboDivJTrTds.get(7).asText());
							refundMXPayInfo.setShouXuFei(pxboDivJTrTds.get(8).getTextContent());
							refundMXPayInfo.setTuiHuanJinE(pxboDivJTrTds.get(9).asText());
							refundMXPayInfoList.add(refundMXPayInfo);
						}
						refundMXPayInfoSet.setRefundMXPayInfoList(refundMXPayInfoList);
						refundMXPayInfoSetList.add(refundMXPayInfoSet);
					}
					map.put("refundMXPayInfoSetList", refundMXPayInfoSetList);
					return map;
				}
			}
			synchronized (refundListMXPage) {
				try {
					refundListMXPage.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
					refundListMXPage.setPRE(CS.FAIL);
					refundListMXPage.getHtmlPage().cleanUp();
					log.info(refundListMXPage.getPRE());
				}
				refundListMXPage.setPRE(CS.LOADING);
				log.info(refundListMXPage.getPRE());
			}
		}
		refundListMXPage.setPRE(CS.FAIL);
		refundListMXPage.setPRE(CS.TIMEOUT);
		log.info(refundListMXPage.getPRE());
		return map;
	}

	
	
	
	
	/**
	 * 加载退票页面(测试)
	 */
	@Override
	public Map<String, Object> refund111(String url111) {
		scl.bbbb = null;
		refundPage = webClient.getCsairHtmlPage(url111, "URLRefund", false);
		for (int i = 0; i <= timeoutmax; i++) {
			if (refundPage.getHtmlPage() == null) {
				refundPage.setPRE(CS.FAIL);
				log.info(refundPage.getPRE());
			}
			
			if (scl.bbbb != null) {
				HtmlPage page = refundPage.getHtmlPage();
				List<HtmlElement> inputnobdbgs = page.getBody().getElementsByAttribute("td", "class", "inputnobdbg");
				log.info("scl.bbbb====>"+scl.bbbb);
				log.info("inputnobdbgs.size()====>"+inputnobdbgs.size());
//				List<HtmlElement> inputnobdbgs = page.getBody().getElementsByAttribute("td", "class", "inputnobdbg");
//				log.info("inputnobdbgs.size()====>"+inputnobdbgs.size());
				for (int i1 = 0; i1 < inputnobdbgs.size(); i1++) {
					HtmlElement inputnobdbg = inputnobdbgs.get(i1);
					DomNodeList<HtmlElement> checkInputs = inputnobdbg.getElementsByTagName("input");
					if(checkInputs.size() != 0) {
						log.info("===========000000================");
						HtmlElement checkInput = checkInputs.get(0);
						clickHandler(checkInput);
						log.info("===========111111================");
						
					}
				}
				for (int i1 = 0; i1 < timeoutmax; i1++) {
					if(scl.aaaa != null) {
						scl.aaaa = null;
						break;
					}
					synchronized (page) {
						try {
							page.wait(100);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						log.info("等待1111111.......");
					}
				}
				
				HtmlSelect REFUNDTYPE = (HtmlSelect) page.getElementById("REFUNDTYPE");
				clickHandler(REFUNDTYPE);
				log.info("==========2222222====================");
				for (int i1 = 0; i1 < timeoutmax; i1++) {
					if(scl.aaaa != null) {
						scl.aaaa = null;
						break;
					}
					synchronized (page) {
						try {
							page.wait(100);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						log.info("等待22222.......");
					}
				}
				HtmlOption option = REFUNDTYPE.getOptionByValue("航班延误/取消");
				clickHandler(option);
//				option.setSelected(true);
				log.info("==========3333333====================");
				for (int i1 = 0; i1 < timeoutmax; i1++) {
					if(scl.aaaa != null) {
						scl.aaaa = null;
						break;
					}
					synchronized (page) {
						try {
							page.wait(100);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						log.info("等待33333.......");
					}
				}
				HtmlInput REFUNDREMARK = (HtmlInput) page.getElementById("REFUNDREMARK");
				REFUNDREMARK.focus();
				REFUNDREMARK.setValueAttribute("航班取消");
				REFUNDREMARK.blur();
				log.info("===========444444================");
				for (int i1 = 0; i1 < timeoutmax; i1++) {
					if(scl.aaaa != null) {
						scl.aaaa = null;
						break;
					}
					synchronized (page) {
						try {
							page.wait(100);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						log.info("等待44444.......");
					}
				}
				HtmlAnchor bluebtnsty = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "class", "bluebtnsty").get(0);
				page = clickHandler(bluebtnsty);
				for (int i1 = 0; i1 < timeoutmax; i1++) {
					if(scl.aaaa != null) {
						log.info("===========55555==============");
						scl.aaaa = null;
						break;
					}
					synchronized (page) {
						try {
							page.wait(100);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						log.info("等待55555......");
					}
				}
			break;	
			}	
			
			synchronized (refundPage) {
				try {
					refundPage.wait(1000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载退票页面。。。。。。。。");
			}
		}		
		return null;
	}
	
	
	
	/**
	 * 加载退票页面
	 */
	public Map<String, Object> refund(String orderNo,HttpSession session) {
		scl.bbbb = null;
		Map<String , Object> map  = new HashMap<String, Object>();
		String URLRefund = Csair.URRefundPage + orderNo;
		refundPage = webClient.getCsairHtmlPage(URLRefund, "URLRefund", false);
		for (int i = 0; i <= timeoutmax; i++) {
			if (refundPage.getHtmlPage() == null) {
				refundPage.setPRE(CS.FAIL);
				log.info(refundPage.getPRE());
			}
			HtmlPage page = refundPage.getHtmlPage();
			List<HtmlElement> inputnobdbgs = page.getBody().getElementsByAttribute("td", "class", "inputnobdbg");
			if (inputnobdbgs.size() != 0) {
				refundPage.setPRE(CS.SUCCESS);
				log.info("=================="+refundPage.getPRE());
			
				String segstr = page.getElementById("segstr").asText();//航程
				log.info("segstr====>"+segstr);
				String totalPrice = page.getElementById("totalprice").asText();//合计
				log.info("totalPrice==>"+totalPrice);
				
				HtmlElement detail0 = (HtmlElement) page.getElementById("detail0");
				String detail0Text = detail0.getElementsByAttribute("div", "class", "prompt sytj").get(0).getTextContent();
				log.info("detail0Text==>"+detail0Text);
				
				map.put("segstr", segstr);
				map.put("totalPrice", totalPrice);
				map.put("detail0", detail0Text);
				
				List<OrderMXFlihgtInfo> orderMXFlihgtInfoList = new ArrayList<OrderMXFlihgtInfo>();
				HtmlTable tablesegTable = (HtmlTable) page.getElementById("tableseg");
				Document tablesegTableDoc = Jsoup.parse(tablesegTable.asXml());
				Elements tablesegTableDocTrs = tablesegTableDoc.select("tr");
				for (int i1 = 0; i1 < (tablesegTableDocTrs.size()-1)/2; i1++) {
					OrderMXFlihgtInfo orderMXFlihgtInfo = new OrderMXFlihgtInfo();
					Element tablesegTableDocTr = tablesegTableDocTrs.get(i1*2+1);
					Elements tablesegTableDocTds = tablesegTableDocTr.select("td");
					orderMXFlihgtInfo.setFlightNo(tablesegTableDocTds.get(0).text());//航班号
					orderMXFlihgtInfo.setBerth(tablesegTableDocTds.get(1).text());//舱位
					orderMXFlihgtInfo.setType(tablesegTableDocTds.get(2).text());//机型
					orderMXFlihgtInfo.setDate(tablesegTableDocTds.get(3).text());//日期
					orderMXFlihgtInfo.setSendTime(tablesegTableDocTds.get(4).text());//出发时间
					orderMXFlihgtInfo.setArrTime(tablesegTableDocTds.get(5).text());//到达时间
					orderMXFlihgtInfoList.add(orderMXFlihgtInfo);
				}
				map.put("orderMXFlihgtInfoList", orderMXFlihgtInfoList);
				
				List<RefundFlihgtInfoListtotle> refundFlihgtInfoListtotleList = new ArrayList<RefundFlihgtInfoListtotle>();
				HtmlDivision ApplyRefundDiv = (HtmlDivision) page.getElementById("ApplyRefundDiv");
				Document ApplyRefundDivDoc = Jsoup.parse(ApplyRefundDiv.asXml());
				Elements lopxDivs = ApplyRefundDivDoc.select(".lopx");
				for (int j = 0; j < lopxDivs.size(); j++) {
					RefundFlihgtInfoListtotle refundFlihgtInfoListtotle = new RefundFlihgtInfoListtotle();
					List<RefundFlihgtInfo> refundFlihgtInfoList = new ArrayList<RefundFlihgtInfo>();
					String hangDuan = ApplyRefundDivDoc.select("h2").get(j).text();//航段
					Element lopxDiv = lopxDivs.get(j);
					Elements usercoxTableDocTrs = lopxDiv.select("tr");
					log.info("size=====>"+(usercoxTableDocTrs.size() - 1));
					for (int i1 = 1; i1 < usercoxTableDocTrs.size() - 1; i1++) {
						RefundFlihgtInfo refundFlihgtInfo = new RefundFlihgtInfo();
						Element usercoxTableDocTr = usercoxTableDocTrs.get(i1);
						Elements usercoxTableDocTds = usercoxTableDocTr.select("td");
						refundFlihgtInfo.setXuhao(usercoxTableDocTds.get(1).text());//序号
						refundFlihgtInfo.setName(usercoxTableDocTds.get(2).text());//旅客姓名
						log.info("usercoxTableDocTds.get(2).text()===>"+usercoxTableDocTds.get(2).text());
						refundFlihgtInfo.setType(usercoxTableDocTds.get(3).text());//旅客类型
						refundFlihgtInfo.setNum(usercoxTableDocTds.get(4).text());//证件号码
						refundFlihgtInfo.setJcs(usercoxTableDocTds.get(5).text());//机场税
						refundFlihgtInfo.setRys(usercoxTableDocTds.get(6).text());//燃油税
						refundFlihgtInfo.setPrice(usercoxTableDocTds.get(7).text());//票价
						refundFlihgtInfo.setYhq(usercoxTableDocTds.get(8).text());//优惠券
						refundFlihgtInfoList.add(refundFlihgtInfo);
					}
					refundFlihgtInfoListtotle.setHangDuan(hangDuan);
					refundFlihgtInfoListtotle.setRefundFlihgtInfos(refundFlihgtInfoList);
					refundFlihgtInfoListtotleList.add(refundFlihgtInfoListtotle);
				}
				map.put("refundFlihgtInfoListtotleList", refundFlihgtInfoListtotleList);
				
				HtmlDivision applyfundinfoDiv = (HtmlDivision) page.getElementById("applyfundinfo");
				map.put("applyfundinfo", applyfundinfoDiv.asXml());
				session.setAttribute("refundPage", page);
				return map;
			}
			synchronized (refundPage) {
				try {
					refundPage.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
					refundPage.setPRE(CS.FAIL);
					refundPage.getHtmlPage().cleanUp();
					log.info(refundPage.getPRE());
				}
				refundPage.setPRE(CS.LOADING);
				log.info(refundPage.getPRE());
			}
		}
		refundPage.setPRE(CS.FAIL);
		refundPage.setPRE(CS.TIMEOUT);
		log.info(refundPage.getPRE());
		
		return map;
	}
	
	/**
	 * 退票点击下一步
	 */
	@Override
	public Map<String, Object> refundNext(String refundtype, String beizhu, HttpSession session) {
		alertMessage = null;
		scl.refundSuceess = null;
		log.info("refundtype====>"+refundtype);
		log.info("beizhu====>"+beizhu);
		Map<String , Object> map  = new HashMap<String, Object>();
		HtmlPage page = (HtmlPage) session.getAttribute("refundPage");
		List<HtmlElement> userListTables = page.getBody().getElementsByAttribute("table", "class", "user-cox-list");
		for (int i = 0; i < userListTables.size(); i++) {
			HtmlElement userListTable = userListTables.get(i);
			DomNodeList<HtmlElement> userListTableInputs = userListTable.getElementsByTagName("input");
			for (int j = 0; j < userListTableInputs.size(); j++) {
				HtmlElement userListTableInput = userListTableInputs.get(j);
				String userListTableInputId = userListTableInput.getAttribute("id");
				log.info("userListTableInputId====>"+userListTableInputId);
				StringBuilder js = new StringBuilder();
		        js.append("document.getElementById('").append(userListTableInputId).append("').checked=true;");  
		        page.executeJavaScript(js.toString());
			}
		}
		
		StringBuilder js2 = new StringBuilder();
        js2.append("$('#REFUNDTYPE').val('").append(refundtype).append("');");  
        page.executeJavaScript(js2.toString());

        StringBuilder js3 = new StringBuilder();
        js3.append("$('#REFUNDREMARK').val('").append(beizhu).append("');");  
        page.executeJavaScript(js3.toString());
        
//        page.executeJavaScript("$('#REFUNDREMARK').val('电商部测试');");
//        page.executeJavaScript("$('script:last').append('jQuery.createXMLDocument = function(string){return string}')");
//        page.executeJavaScript("$('#waitingdiv1').append(jQuery.createXMLDocument('<page><page><TICKETS><ROW><TICKETNO>7842383385847</TICKETNO></ROW></TICKETS></page></page>'));");
        
        HtmlInput checkInput = (HtmlInput) page.getElementById("1,1");
        String ticketno = checkInput.getAttribute("ticketno");
        StringBuilder js4 = new StringBuilder();
        js4.append("$.ajax({url: '/B2C40/data/ets/checkPrint.xsql',contentType:'text/xml',dataType:'xml',async:false,data:'<page><page><TICKETS><ROW><TICKETNO>").append(ticketno).append("</TICKETNO></ROW></TICKETS></page></page>',processData:false,type:'POST',	success: function(msg){}});	");  
        String str = page.executeJavaScript(js4.toString()).toString();
        log.info("str====>"+str);
//        String str = "$.ajax({url: '/B2C40/data/ets/checkPrint.xsql',contentType:'text/xml',dataType:'xml',async:false,data:'<page><page><TICKETS><ROW><TICKETNO>7842383368290</TICKETNO></ROW></TICKETS></page></page>',processData:false,type:'POST',	success: function(msg){}});	";
        if(refundtype.contains("自愿")) {
        	log.info("自愿！！！！");
        	page.executeJavaScript("doApplyRefund4Addon();");
        }else {
        	page.executeJavaScript("Refund();");
        }
       
        for (int i = 0; i < timeoutmax; i++) {
        	if(alertMessage != null) {
    			map.put("msg", alertMessage);
    			if(alertMessage.contains("成功")) {
    				map.put("notice", "true");
    			}else {
    				map.put("notice", "false");
    			}
    			return map;
    		}
        	if(scl.refundSuceess != null) {
        		map.put("msg", "退票申请已提交！");
        		map.put("notice", "true");
    			return map;
        	}
        	synchronized (page) {
				try {
					page.wait(500);
					log.info("等待退票........");
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
        map.put("msg", "退票超时，退票失败！");
        map.put("notice", "false");
		return null;
	}
	
	/**
	 * 退票最后页
	 */
//	@Override
//	public Map<String, Object> refundFinal(HttpSession session) {
//		Map<String , Object> map  = new HashMap<String, Object>();
//		HtmlPage page2 = (HtmlPage) session.getAttribute("page2");
//		
//		return map;
//	}


	
	/**
	 * 加载变更页面1
	 */
	@Override
	public Map<String, Object> change1(String orderNo, HttpSession session) {
		scl.change2 = null;
		alertMessage = null;
		Map<String , Object> map  = new HashMap<String, Object>();
		String URLChange = Csair.URChangePage + orderNo;
		changePage = webClient.getCsairHtmlPage(URLChange, "URLChange", false);
		for (int i = 0; i < timeoutmax; i++) {
			if (changePage.getHtmlPage() == null) {
				changePage.setPRE(CS.FAIL);
				log.info(changePage.getPRE());
			}else{
				if(alertMessage != null) {
					map.put("notice","false");
					map.put("msg", alertMessage);
					return map;
				}else {
					for (int j = 0; j < timeoutmax; j++) {
						HtmlPage page = changePage.getHtmlPage();
						HtmlElement detail0 = (HtmlElement) page.getElementById("1");//使用条件详情
						if (detail0 != null && detail0.asText().trim() !="") {
							session.setAttribute("page", page);
							map.put("notice","true");
							return map;
						}
						synchronized (page) {
							try {
								page.wait(500);
							} catch (InterruptedException e) {
								// TODO Auto-generated catch block
								e.printStackTrace();
							}
							log.info("加载change页面........");
						}
					}
					map.put("notice","false");
					map.put("msg", "页面加载失败！");
					return map;
					
				}
			}
			synchronized (changePage) {
				try {
					changePage.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
					changePage.setPRE(CS.FAIL);
					changePage.getHtmlPage().cleanUp();
					log.info(changePage.getPRE());
				}
				changePage.setPRE(CS.LOADING);
				log.info(changePage.getPRE());
			}
		}
		changePage.setPRE(CS.FAIL);
		changePage.setPRE(CS.TIMEOUT);
		log.info(changePage.getPRE());
		
		return map;
	}



	/**
	 * 加载变更页面2
	 */
	@Override
	public Map<String, Object> change(String orderNo,HttpSession session) {
		scl.change2 = null;
		Map<String , Object> map  = new HashMap<String, Object>();
//		String URLChange = Csair.URChangePage + orderNo;
//		changePage = webClient.getCsairHtmlPage(URLChange, "URLChange", false);
//		for (int i = 0; i <= timeoutmax; i++) {
//			if (changePage.getHtmlPage() == null) {
//				changePage.setPRE(CS.FAIL);
//				log.info(changePage.getPRE());
//			}
			
//			HtmlPage page = changePage.getHtmlPage();
//			HtmlElement detail0 = (HtmlElement) page.getElementById("1");//使用条件详情
//			if (detail0 != null && detail0.asText().trim() !="") {
//				changePage.setPRE(CS.SUCCESS);
//				log.info("=================="+changePage.getPRE());
			
				HtmlPage page = (HtmlPage) session.getAttribute("page");
				
				String segstr = page.getElementById("segstr").asText();//航程
				log.info("segstr====>"+segstr);
				
				HtmlElement detail0 = (HtmlElement) page.getElementById("1");
				String detail0Text = detail0.getElementsByAttribute("div", "class", "prompt sytj").get(0).getTextContent();
				log.info("detail0Text==>"+detail0Text);
				map.put("segstr", segstr);
				map.put("detail0", detail0Text);
				
				HtmlAnchor bluebtnsty = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "class", "bluebtnsty").get(0);
				HtmlSpan span = (HtmlSpan) bluebtnsty.getElementsByTagName("span").get(0);
				HtmlPage page2 = clickHandler(span);
					
				for (int i1 = 0; i1 <= timeoutmax; i1++) {
					List<HtmlElement> inputnobdbgs = page2.getBody().getElementsByAttribute("td", "class", "inputnobdbg");
					if(inputnobdbgs.size() != 0) {
						change2Page.setPRE(CS.SUCCESS);
						log.info("=================="+change2Page.getPRE());
						
						List<OrderMXFlihgtInfo> orderMXFlihgtInfoList = new ArrayList<OrderMXFlihgtInfo>();
						HtmlDivision pxboDiv = (HtmlDivision) page2.getBody().getElementsByAttribute("div", "class", "pxbo").get(0);
						Document pxboDivDoc = Jsoup.parse(pxboDiv.asXml());
						Elements pxboDivDocTrs = pxboDivDoc.select("tr.text_ct");
						for (int i11 = 0; i11 < pxboDivDocTrs.size(); i11++) {
							OrderMXFlihgtInfo orderMXFlihgtInfo = new OrderMXFlihgtInfo();
							Element pxboDivDocTr = pxboDivDocTrs.get(i11);
							Elements pxboDivDocTds = pxboDivDocTr.select("td");
							orderMXFlihgtInfo.setFlightNo(pxboDivDocTds.get(0).text());//航班号
							orderMXFlihgtInfo.setBerth(pxboDivDocTds.get(1).text());//舱位
							orderMXFlihgtInfo.setType(pxboDivDocTds.get(2).text());//机型
							orderMXFlihgtInfo.setDate(pxboDivDocTds.get(3).text());//日期
							orderMXFlihgtInfo.setSendTime(pxboDivDocTds.get(4).text());//出发时间
							orderMXFlihgtInfo.setArrTime(pxboDivDocTds.get(5).text());//到达时间
							orderMXFlihgtInfoList.add(orderMXFlihgtInfo);
						}
						map.put("orderMXFlihgtInfoList", orderMXFlihgtInfoList);
						
						List<ChangeFlihgtInfo> changeFlihgtInfoList = new ArrayList<ChangeFlihgtInfo>();
						HtmlDivision pxboDiv2 = (HtmlDivision) page2.getBody().getElementsByAttribute("div", "class", "pxbo").get(1);
						Document pxboDiv2Doc = Jsoup.parse(pxboDiv2.asXml());
						Elements pxboDiv2DocTrs = pxboDiv2Doc.select("tr");
						for (int i11 = 1; i11 < pxboDiv2DocTrs.size(); i11++) {
							ChangeFlihgtInfo changeFlihgtInfo = new ChangeFlihgtInfo();
							Element pxboDiv2DocTr = pxboDiv2DocTrs.get(i11);
							Elements pxboDiv2DocTds = pxboDiv2DocTr.select("td");
							changeFlihgtInfo.setXuhao(pxboDiv2DocTds.get(0).text());//序号
							changeFlihgtInfo.setName(pxboDiv2DocTds.get(1).text());//旅客姓名
							changeFlihgtInfo.setpType(pxboDiv2DocTds.get(2).text());//旅客类型
							changeFlihgtInfo.setcType(pxboDiv2DocTds.get(3).text());//证件类型
							changeFlihgtInfo.setNum(pxboDiv2DocTds.get(4).text());//证件号码
							changeFlihgtInfo.settNum(pxboDiv2DocTds.get(5).text());//票号
							changeFlihgtInfoList.add(changeFlihgtInfo);
						}
						map.put("changeFlihgtInfoList", changeFlihgtInfoList);
						
						List<ChangeFlihgtInfo1> changeFlihgtInfo1List = new ArrayList<ChangeFlihgtInfo1>();
						HtmlDivision uatableDiv = (HtmlDivision) page2.getBody().getElementsByAttribute("div", "class", "ua-table").get(0);
						Document uatableDivDoc = Jsoup.parse(uatableDiv.asXml());
						Elements uatableDivDocTrs = uatableDivDoc.select("tr");
						for (int i11 = 1; i11 < (uatableDivDocTrs.size()+2)/3; i11++) {
							ChangeFlihgtInfo1 changeFlihgtInfo1 = new ChangeFlihgtInfo1();
							Element uatableDivDocTr = uatableDivDocTrs.get(3*i11-2);
							Elements uatableDivDocTds = uatableDivDocTr.select("td");
							changeFlihgtInfo1.setHangBanHao(uatableDivDocTds.get(1).text());//航班号
							changeFlihgtInfo1.setCangWei(uatableDivDocTds.get(2).text());//舱位
							changeFlihgtInfo1.setHangXian(uatableDivDocTds.get(3).text());//航线
							changeFlihgtInfo1.settStatus(uatableDivDocTds.get(4).text());//客票状态
							changeFlihgtInfo1.setbDate(uatableDivDocTds.get(5).text());//原出发日期
							changeFlihgtInfo1List.add(changeFlihgtInfo1);
						}
						map.put("changeFlihgtInfo1List", changeFlihgtInfo1List);
						session.setAttribute("page2", page2);
						return map;
					}
					
					synchronized (page2) {
						try {
							page2.wait(500);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						log.info("加载change2.......");
					}
				}
				change2Page.setPRE(CS.FAIL);
				change2Page.setPRE(CS.TIMEOUT);
				log.info(change2Page.getPRE());
				
//				return map;
//			}
//			synchronized (changePage) {
//				try {
//					changePage.wait(waittime);
//				} catch (InterruptedException e) {
//					e.printStackTrace();
//					changePage.setPRE(CS.FAIL);
//					changePage.getHtmlPage().cleanUp();
//					log.info(changePage.getPRE());
//				}
//				changePage.setPRE(CS.LOADING);
//				log.info(changePage.getPRE());
//			}
//		}
//		changePage.setPRE(CS.FAIL);
//		changePage.setPRE(CS.TIMEOUT);
//		log.info(changePage.getPRE());

		return map;
	}


	/**
	 * 变更点击下一步
	 */
	@Override
	public Map<String, Object> changeNext(List<ChangeDate> list, String changeType, String beizhu, HttpSession session) {
		alertMessage = null;
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page2 = (HtmlPage) session.getAttribute("page2");
		List<HtmlElement> oxdateTds = page2.getBody().getElementsByAttribute("td", "class", "oxdate");
		int a = oxdateTds.size();
		for (int i = 1; i <= a; i++) {
			String id1 = "newdate" + i;
			HtmlInput idInput = (HtmlInput) page2.getElementById(id1);
			String year = list.get(i-1).getYear();
			String month = list.get(i-1).getMonth();
			String day = list.get(i-1).getDay();
			String date = year+"-"+month+"-"+day;
			log.info("date===>"+date);
			idInput.setValueAttribute(date);
			
			String id2= "SELECTSEGMENT" + i;
			HtmlInput SELECTSEGMENT = (HtmlInput) page2.getElementById(id2);
			SELECTSEGMENT.removeAttribute("disabled");
			clickHandler(SELECTSEGMENT);
		}
		
		HtmlSelect changeTypeSelect = (HtmlSelect) page2.getElementById("changeType");
		HtmlOption option = changeTypeSelect.getOptionByValue(changeType);
		option.setSelected(true);
		
		HtmlInput changeRemarkInput = (HtmlInput) page2.getElementById("changeRemark");
		changeRemarkInput.setValueAttribute(beizhu);
		
		HtmlAnchor bluebtnsty = (HtmlAnchor) page2.getBody().getElementsByAttribute("a", "class", "bluebtnsty").get(0);
		HtmlSpan span = (HtmlSpan) bluebtnsty.getElementsByTagName("span").get(0);
		HtmlPage page3 = clickHandler(span);
		if(alertMessage != null) {
			map.put("notice", "false");
			map.put("msg", alertMessage);
			return map;
		}
		
		for (int i = 0; i < timeoutmax; i++) {
			List<HtmlElement> cfsjSpans = page3.getBody().getElementsByAttribute("span", "class", "cfsj");
			if(cfsjSpans.size() != 0) {
				session.setAttribute("page3", page3);
				map.put("notice", "true");
				return map;
			}	
			synchronized (page3) {
				try {
					page3.wait(200);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				log.info("加载change3......");
			}
		}
		map.put("notice", "false");
		map.put("msg", "变更页面加载超时！！！");
		return map;
	}


	/**
	 * 加载变更页面3
	 */
	@Override
	public Map<String, Object> loadChange3(HttpSession session) {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page3 = (HtmlPage) session.getAttribute("page3");
//		log.info(page3.asXml());
		List<OrderMXFlihgtInfo> orderMXFlihgtInfoList = new ArrayList<OrderMXFlihgtInfo>();
		HtmlDivision pxboDiv = (HtmlDivision) page3.getBody().getElementsByAttribute("div", "class", "pxbo").get(0);
		Document pxboDivDoc = Jsoup.parse(pxboDiv.asXml());
		Elements pxboDivDocTrs = pxboDivDoc.select("tr");
		for (int i11 = 1; i11 < (pxboDivDocTrs.size()+1)/2; i11++) {
			OrderMXFlihgtInfo orderMXFlihgtInfo = new OrderMXFlihgtInfo();
			Element pxboDivDocTr = pxboDivDocTrs.get(2*i11-1);
			Elements pxboDivDocTds = pxboDivDocTr.select("td");
			orderMXFlihgtInfo.setFlightNo(pxboDivDocTds.get(0).text());//航班号
			orderMXFlihgtInfo.setBerth(pxboDivDocTds.get(1).text());//舱位
			orderMXFlihgtInfo.setType(pxboDivDocTds.get(2).text());//机型
			orderMXFlihgtInfo.setDate(pxboDivDocTds.get(3).text());//日期
			orderMXFlihgtInfo.setSendTime(pxboDivDocTds.get(4).text());//出发时间
			orderMXFlihgtInfo.setArrTime(pxboDivDocTds.get(5).text());//到达时间
			orderMXFlihgtInfoList.add(orderMXFlihgtInfo);
		}
		map.put("orderMXFlihgtInfoList", orderMXFlihgtInfoList);
		
		List<ChangeFlihgtInfo> changeFlihgtInfoList = new ArrayList<ChangeFlihgtInfo>();
		HtmlDivision pxboDiv2 = (HtmlDivision) page3.getBody().getElementsByAttribute("div", "class", "pxbo").get(1);
		Document pxboDiv2Doc = Jsoup.parse(pxboDiv2.asXml());
		Elements pxboDiv2DocTrs = pxboDiv2Doc.select("tr");
		for (int i11 = 1; i11 < pxboDiv2DocTrs.size(); i11++) {
			ChangeFlihgtInfo changeFlihgtInfo = new ChangeFlihgtInfo();
			Element pxboDiv2DocTr = pxboDiv2DocTrs.get(i11);
			Elements pxboDiv2DocTds = pxboDiv2DocTr.select("td");
			changeFlihgtInfo.setXuhao(pxboDiv2DocTds.get(0).text());//序号
			changeFlihgtInfo.setName(pxboDiv2DocTds.get(1).text());//旅客姓名
			changeFlihgtInfo.setpType(pxboDiv2DocTds.get(2).text());//旅客类型
			changeFlihgtInfo.setcType(pxboDiv2DocTds.get(3).text());//证件类型
			changeFlihgtInfo.setNum(pxboDiv2DocTds.get(4).text());//证件号码
			changeFlihgtInfo.settNum(pxboDiv2DocTds.get(5).text());//票号
			changeFlihgtInfoList.add(changeFlihgtInfo);
		}
		map.put("changeFlihgtInfoList", changeFlihgtInfoList);
		
		
		
		List<ChangeFlihgtHB> changeFlihgtHBList = new ArrayList<ChangeFlihgtHB>();
		
		List<HtmlElement> xcobxs = page3.getBody().getElementsByAttribute("div", "class", "xcobx");
		int m = 0;
		ChangeFlihgtEW changeFlihgtEW = null;
		for (int i = 0; i < xcobxs.size(); i++) {
//			log.info("i=======>"+i);
			m=0;
			ChangeFlihgtHB changeFlihgtHB = new ChangeFlihgtHB();
			List<ChangeFlihgtEW> changeFlihgtEWList = new ArrayList<ChangeFlihgtEW>();
			HtmlDivision xcobx = (HtmlDivision) xcobxs.get(i);
			String xcobxId = xcobx.getAttribute("id");
			HtmlTable atableTable = (HtmlTable) xcobx.getElementsByAttribute("table", "class", "atable").get(0);
//			DomNodeList<HtmlElement> atableTableTrs = atableTable.getElementsByTagName("tr");
			HtmlElement atableTablebody = atableTable.getElementsByTagName("tbody").get(0);
			Iterable<DomElement> atableTableTrs = atableTablebody.getChildElements();
			for (Iterator<DomElement> iterator = atableTableTrs.iterator(); iterator.hasNext();) {
//				log.info("m====>"+m);
				HtmlElement atableTableTr = (HtmlElement) iterator.next();
				if(!atableTableTr.getTagName().equalsIgnoreCase("tr")) {
//					log.info("111111111");
					break;
				}
				if(m !=0 && m%2 == 0) {
					changeFlihgtEW= new ChangeFlihgtEW();
//					log.info("m====>"+m);
//					log.info(atableTableTr.asXml());
					HtmlDivision tlineDiv = (HtmlDivision) atableTableTr.getElementsByAttribute("div", "class", "tline").get(0);
					HtmlSpan cfsjDiv = (HtmlSpan) tlineDiv.getElementsByAttribute("span", "class", "cfsj").get(0);
					String cfTime = cfsjDiv.asText();
					
					HtmlDivision ddsjDiv = (HtmlDivision) tlineDiv.getElementsByTagName("div").get(1);
					String ddTime = ddsjDiv.asText();
					
					HtmlSpan hbnameSpan = (HtmlSpan) atableTableTr.getElementsByAttribute("span", "class", "hbname").get(0);
					String hangBanHao = hbnameSpan.asText();
					
					HtmlElement atableTrEWTd2 = atableTableTr.getElementsByTagName("td").get(2);
					HtmlDivision tdcDiv = (HtmlDivision) atableTrEWTd2.getElementsByTagName("div").get(1);
					HtmlSpan tdcEWaiSpan = (HtmlSpan) tdcDiv.getElementsByTagName("span").get(0);
					String tdcEWai = tdcEWaiSpan.getTextContent();
					DomNodeList<HtmlElement> tdcEWaiInputs = tdcEWaiSpan.getElementsByTagName("input");
					String tdcEWaiId = "";
					if(tdcEWaiInputs.size() != 0) {
						HtmlInput tdcEWaiInput = (HtmlInput) tdcEWaiInputs.get(0);
						tdcEWaiId = tdcEWaiInput.getAttribute("id");
					}
					
					HtmlElement atableTrEWTd3 = atableTableTr.getElementsByTagName("td").get(3);
					HtmlDivision gwcDiv = (HtmlDivision) atableTrEWTd3.getElementsByTagName("div").get(1);
					HtmlSpan gwcEWaiSpan = (HtmlSpan) gwcDiv.getElementsByTagName("span").get(0);
					String gwcEWai = gwcEWaiSpan.getTextContent();
					log.info("gwcEWai===>"+gwcEWai);
					DomNodeList<HtmlElement> gwcEWaiInputs = gwcEWaiSpan.getElementsByTagName("input");
					String gwcEWaiId = "";
					if(gwcEWaiInputs.size() != 0) {
						HtmlInput gwcEWaiInput = (HtmlInput) gwcEWaiInputs.get(0);
						gwcEWaiId = gwcEWaiInput.getAttribute("id");
					}
					
					HtmlElement atableTableTrEWTd4 = atableTableTr.getElementsByTagName("td").get(4);
					HtmlDivision mzjjcDiv = (HtmlDivision) atableTableTrEWTd4.getElementsByTagName("div").get(1);
					HtmlSpan mzjjcEWaiSpan = (HtmlSpan) mzjjcDiv.getElementsByTagName("span").get(0);
					String mzjjcEWai = mzjjcEWaiSpan.getTextContent();
					DomNodeList<HtmlElement> mzjjcEWaiInputs = mzjjcEWaiSpan.getElementsByTagName("input");
					String mzjjcEWaiId = "";
					if(mzjjcEWaiInputs.size() != 0) {
						HtmlInput mzjjcEWaiInput = (HtmlInput) mzjjcEWaiInputs.get(0);
						mzjjcEWaiId = mzjjcEWaiInput.getAttribute("id");
					}
					
					HtmlElement atableTableTrEWTd5 = atableTableTr.getElementsByTagName("td").get(5);
					HtmlDivision slyDiv = (HtmlDivision) atableTableTrEWTd5.getElementsByTagName("div").get(1);
					HtmlSpan slyEWaiSpan = (HtmlSpan) slyDiv.getElementsByTagName("span").get(0);
					String slyEWai = slyEWaiSpan.getTextContent();
					DomNodeList<HtmlElement> slyEWaiInputs = slyEWaiSpan.getElementsByTagName("input");
					String slyEWaiId = "";
					if(slyEWaiInputs.size() != 0) {
						HtmlInput slyEWaiInput = (HtmlInput) slyEWaiInputs.get(0);
						slyEWaiId = slyEWaiInput.getAttribute("id");
					}
					
					HtmlElement atableTableTrEWTd6 = atableTableTr.getElementsByTagName("td").get(6);
					HtmlDivision yxpDiv = (HtmlDivision) atableTableTrEWTd6.getElementsByTagName("div").get(1);
					HtmlSpan yxpEWaiSpan = (HtmlSpan) yxpDiv.getElementsByTagName("span").get(0);
					String yxpEWai = yxpEWaiSpan.getTextContent();
					DomNodeList<HtmlElement> yxpEWaiInputs = yxpEWaiSpan.getElementsByTagName("input");
					String yxpEWaiId = "";
					if(yxpEWaiInputs.size() != 0) {
						HtmlInput yxpEWaiInput = (HtmlInput) yxpEWaiInputs.get(0);
						yxpEWaiId = yxpEWaiInput.getAttribute("id");
					}
					
					HtmlElement atableTableTrEWTd7 = atableTableTr.getElementsByTagName("td").get(7);
					HtmlDivision klfDiv = (HtmlDivision) atableTableTrEWTd7.getElementsByTagName("div").get(1);
					HtmlSpan klfEWaiSpan = (HtmlSpan) klfDiv.getElementsByTagName("span").get(0);
					String klfEWai = klfEWaiSpan.getTextContent();
					DomNodeList<HtmlElement> klfEWaiInputs = klfEWaiSpan.getElementsByTagName("input");
					String klfEWaiId = "";
					if(klfEWaiInputs.size() != 0) {
						HtmlInput klfEWaiInput = (HtmlInput) klfEWaiInputs.get(0);
						klfEWaiId = klfEWaiInput.getAttribute("id");
					}
					changeFlihgtEW.setXcobxId(xcobxId);
					changeFlihgtEW.setCfTime(cfTime);
					changeFlihgtEW.setDdTime(ddTime);
					changeFlihgtEW.setHangBanHao(hangBanHao);
					changeFlihgtEW.setTdcEWai(tdcEWai);
					changeFlihgtEW.setTdcEWaiId(tdcEWaiId);
					changeFlihgtEW.setGwcEWai(gwcEWai);
					changeFlihgtEW.setGwcEWaiId(gwcEWaiId);
					changeFlihgtEW.setMzjjcEWai(mzjjcEWai);
					changeFlihgtEW.setMzjjcEWaiId(mzjjcEWaiId);
					changeFlihgtEW.setSlyEWai(slyEWai);
					changeFlihgtEW.setSlyEWaiId(slyEWaiId);
					changeFlihgtEW.setYxpEWai(yxpEWai);
					changeFlihgtEW.setYxpEWaiId(yxpEWaiId);
					changeFlihgtEW.setKlfEWai(klfEWai);
					changeFlihgtEW.setKlfEWaiId(klfEWaiId);
				}
				
				if(m !=0 && m !=1 && m%2 ==1) {
//					log.info("m====>"+m);
					HtmlTable showmxTable = (HtmlTable) atableTableTr.getElementsByAttribute("table", "class", "showmxtable").get(0);
					
					List<Changed3ChangeInfo> changed3ChangeTdcList = new ArrayList<Changed3ChangeInfo>();
					List<Changed3ChangeInfo> changed3ChangeGwcList = new ArrayList<Changed3ChangeInfo>();
					List<Changed3ChangeInfo> changed3ChangeMzjjcList = new ArrayList<Changed3ChangeInfo>();
					List<Changed3ChangeInfo> changed3ChangeSlyList = new ArrayList<Changed3ChangeInfo>();
					List<Changed3ChangeInfo> changed3ChangeYxpList = new ArrayList<Changed3ChangeInfo>();
					List<Changed3ChangeInfo> changed3ChangeKlfList = new ArrayList<Changed3ChangeInfo>();
					HtmlTableBody tdc1Tbody = (HtmlTableBody) showmxTable.getElementsByTagName("tbody").get(1);
					DomNodeList<HtmlElement> tdc1Trs = tdc1Tbody.getElementsByTagName("tr");
					if(tdc1Trs.size() != 0) {
						for (int i1 = 0; i1 < tdc1Trs.size(); i1++) {
							Changed3ChangeInfo changed3ChangeInfoTdc = new Changed3ChangeInfo();
							HtmlElement tdc1Tr = tdc1Trs.get(i1);
							HtmlElement td0 = tdc1Tr.getElementsByTagName("td").get(0);
							HtmlDivision td0Div1 = (HtmlDivision) td0.getElementsByTagName("div").get(1);
							HtmlSpan td0Div1Span = (HtmlSpan) td0Div1.getElementsByTagName("span").get(0);
							HtmlInput td0Div1SpanInput = (HtmlInput) td0Div1Span.getElementsByTagName("input").get(0);
							String cangWeiJiaGeId = td0Div1SpanInput.getAttribute("id");
							String cangWeiJiaGe = td0Div1Span.getTextContent();
							HtmlElement td1 = tdc1Tr.getElementsByTagName("td").get(1);
							HtmlElement td2 = tdc1Tr.getElementsByTagName("td").get(2);
							HtmlElement td3 = tdc1Tr.getElementsByTagName("td").get(3);
							HtmlElement td4 = tdc1Tr.getElementsByTagName("td").get(4);
							HtmlElement td5 = tdc1Tr.getElementsByTagName("td").get(5);
							String changeTimeBefore = td1.getTextContent();
							String changeTimeAfter = td2.getTextContent();
							String refundTimeBefore = td3.getTextContent();
							String refundTimeAfter = td4.getTextContent();
							String ziYuan = td5.getTextContent();
							
							changed3ChangeInfoTdc.setXcobxId(xcobxId);
							changed3ChangeInfoTdc.setCangWeiJiaGeId(cangWeiJiaGeId);
							changed3ChangeInfoTdc.setCangWeiJiaGe(cangWeiJiaGe);
							changed3ChangeInfoTdc.setChangeTimeBefore(changeTimeBefore);
							changed3ChangeInfoTdc.setChangeTimeAfter(changeTimeAfter);
							changed3ChangeInfoTdc.setRefundTimeBefore(refundTimeBefore);
							changed3ChangeInfoTdc.setRefundTimeAfter(refundTimeAfter);
							changed3ChangeInfoTdc.setZiYuan(ziYuan);
							changed3ChangeTdcList.add(changed3ChangeInfoTdc);
						}
						changeFlihgtEW.setChanged3ChangeTdcList(changed3ChangeTdcList);
					}
					
					HtmlTableBody gwc1Tbody = (HtmlTableBody) showmxTable.getElementsByTagName("tbody").get(2);
					DomNodeList<HtmlElement> gwc1Trs = gwc1Tbody.getElementsByTagName("tr");
					if(gwc1Trs.size() != 0) {
						for (int i1 = 0; i1 < gwc1Trs.size(); i1++) {
							Changed3ChangeInfo changed3ChangeInfoGwc = new Changed3ChangeInfo();
							HtmlElement gwc1Tr = gwc1Trs.get(i1);
							HtmlElement td0 = gwc1Tr.getElementsByTagName("td").get(0);
							HtmlDivision td0Div1 = (HtmlDivision) td0.getElementsByTagName("div").get(1);
							HtmlSpan td0Div1Span = (HtmlSpan) td0Div1.getElementsByTagName("span").get(0);
							HtmlInput td0Div1SpanInput = (HtmlInput) td0Div1Span.getElementsByTagName("input").get(0);
							String cangWeiJiaGeId = td0Div1SpanInput.getAttribute("id");
							String cangWeiJiaGe = td0Div1Span.getTextContent();
							HtmlElement td1 = gwc1Tr.getElementsByTagName("td").get(1);
							HtmlElement td2 = gwc1Tr.getElementsByTagName("td").get(2);
							HtmlElement td3 = gwc1Tr.getElementsByTagName("td").get(3);
							HtmlElement td4 = gwc1Tr.getElementsByTagName("td").get(4);
							HtmlElement td5 = gwc1Tr.getElementsByTagName("td").get(5);
							String changeTimeBefore = td1.getTextContent();
							String changeTimeAfter = td2.getTextContent();
							String refundTimeBefore = td3.getTextContent();
							String refundTimeAfter = td4.getTextContent();
							String ziYuan = td5.getTextContent();
							
							changed3ChangeInfoGwc.setXcobxId(xcobxId);
							changed3ChangeInfoGwc.setCangWeiJiaGeId(cangWeiJiaGeId);
							changed3ChangeInfoGwc.setCangWeiJiaGe(cangWeiJiaGe);
							changed3ChangeInfoGwc.setChangeTimeBefore(changeTimeBefore);
							changed3ChangeInfoGwc.setChangeTimeAfter(changeTimeAfter);
							changed3ChangeInfoGwc.setRefundTimeBefore(refundTimeBefore);
							changed3ChangeInfoGwc.setRefundTimeAfter(refundTimeAfter);
							changed3ChangeInfoGwc.setZiYuan(ziYuan);
							changed3ChangeGwcList.add(changed3ChangeInfoGwc);
						}
						changeFlihgtEW.setChanged3ChangeGwcList(changed3ChangeGwcList);
					}
					
					HtmlTableBody mzjjc1Tbody = (HtmlTableBody) showmxTable.getElementsByTagName("tbody").get(3);
					DomNodeList<HtmlElement> mzjjc1Trs = mzjjc1Tbody.getElementsByTagName("tr");
					if(mzjjc1Trs.size() != 0) {
						for (int i1 = 0; i1 < mzjjc1Trs.size(); i1++) {
							Changed3ChangeInfo changed3ChangeInfoMzjjc = new Changed3ChangeInfo();
							HtmlElement mzjjc1Tr = mzjjc1Trs.get(i1);
							HtmlElement td0 = mzjjc1Tr.getElementsByTagName("td").get(0);
							HtmlDivision td0Div1 = (HtmlDivision) td0.getElementsByTagName("div").get(1);
							HtmlSpan td0Div1Span = (HtmlSpan) td0Div1.getElementsByTagName("span").get(0);
							HtmlInput td0Div1SpanInput = (HtmlInput) td0Div1Span.getElementsByTagName("input").get(0);
							String cangWeiJiaGeId = td0Div1SpanInput.getAttribute("id");
							String cangWeiJiaGe = td0Div1Span.getTextContent();
							HtmlElement td1 = mzjjc1Tr.getElementsByTagName("td").get(1);
							HtmlElement td2 = mzjjc1Tr.getElementsByTagName("td").get(2);
							HtmlElement td3 = mzjjc1Tr.getElementsByTagName("td").get(3);
							HtmlElement td4 = mzjjc1Tr.getElementsByTagName("td").get(4);
							HtmlElement td5 = mzjjc1Tr.getElementsByTagName("td").get(5);
							String changeTimeBefore = td1.getTextContent();
							String changeTimeAfter = td2.getTextContent();
							String refundTimeBefore = td3.getTextContent();
							String refundTimeAfter = td4.getTextContent();
							String ziYuan = td5.getTextContent();
							
							changed3ChangeInfoMzjjc.setXcobxId(xcobxId);
							changed3ChangeInfoMzjjc.setCangWeiJiaGeId(cangWeiJiaGeId);
							changed3ChangeInfoMzjjc.setCangWeiJiaGe(cangWeiJiaGe);
							changed3ChangeInfoMzjjc.setChangeTimeBefore(changeTimeBefore);
							changed3ChangeInfoMzjjc.setChangeTimeAfter(changeTimeAfter);
							changed3ChangeInfoMzjjc.setRefundTimeBefore(refundTimeBefore);
							changed3ChangeInfoMzjjc.setRefundTimeAfter(refundTimeAfter);
							changed3ChangeInfoMzjjc.setZiYuan(ziYuan);
							changed3ChangeMzjjcList.add(changed3ChangeInfoMzjjc);
						}
						changeFlihgtEW.setChanged3ChangeMzjjcList(changed3ChangeMzjjcList);
					}
					
					HtmlTableBody sly1Tbody = (HtmlTableBody) showmxTable.getElementsByTagName("tbody").get(4);
					DomNodeList<HtmlElement> sly1Trs = sly1Tbody.getElementsByTagName("tr");
					if(sly1Trs.size() != 0) {
						for (int i1 = 0; i1 < sly1Trs.size()-1; i1++) {
							Changed3ChangeInfo changed3ChangeInfoSly = new Changed3ChangeInfo();
							HtmlElement sly1Tr = sly1Trs.get(i1);
							HtmlElement td0 = sly1Tr.getElementsByTagName("td").get(0);
							HtmlDivision td0Div1 = (HtmlDivision) td0.getElementsByTagName("div").get(1);
							HtmlSpan td0Div1Span = (HtmlSpan) td0Div1.getElementsByTagName("span").get(0);
							HtmlInput td0Div1SpanInput = (HtmlInput) td0Div1Span.getElementsByTagName("input").get(0);
							String cangWeiJiaGeId = td0Div1SpanInput.getAttribute("id");
							String cangWeiJiaGe = td0Div1Span.getTextContent();
							HtmlElement td1 = sly1Tr.getElementsByTagName("td").get(1);
							HtmlElement td2 = sly1Tr.getElementsByTagName("td").get(2);
							HtmlElement td3 = sly1Tr.getElementsByTagName("td").get(3);
							HtmlElement td4 = sly1Tr.getElementsByTagName("td").get(4);
							HtmlElement td5 = sly1Tr.getElementsByTagName("td").get(5);
							String changeTimeBefore = td1.getTextContent();
							String changeTimeAfter = td2.getTextContent();
							String refundTimeBefore = td3.getTextContent();
							String refundTimeAfter = td4.getTextContent();
							String ziYuan = td5.getTextContent();
							
							changed3ChangeInfoSly.setXcobxId(xcobxId);
							changed3ChangeInfoSly.setCangWeiJiaGeId(cangWeiJiaGeId);
							changed3ChangeInfoSly.setCangWeiJiaGe(cangWeiJiaGe);
							changed3ChangeInfoSly.setChangeTimeBefore(changeTimeBefore);
							changed3ChangeInfoSly.setChangeTimeAfter(changeTimeAfter);
							changed3ChangeInfoSly.setRefundTimeBefore(refundTimeBefore);
							changed3ChangeInfoSly.setRefundTimeAfter(refundTimeAfter);
							changed3ChangeInfoSly.setZiYuan(ziYuan);
							changed3ChangeSlyList.add(changed3ChangeInfoSly);
						}
						changeFlihgtEW.setChanged3ChangeSlyList(changed3ChangeSlyList);
					}
					
					HtmlTableBody yxp1Tbody = (HtmlTableBody) showmxTable.getElementsByTagName("tbody").get(5);
					DomNodeList<HtmlElement> yxp1Trs = yxp1Tbody.getElementsByTagName("tr");
					if(yxp1Trs.size() != 0) {
						for (int i1 = 0; i1 < yxp1Trs.size(); i1++) {
							Changed3ChangeInfo changed3ChangeInfoYxp = new Changed3ChangeInfo();
							HtmlElement yxp1Tr = yxp1Trs.get(i1);
							HtmlElement td0 = yxp1Tr.getElementsByTagName("td").get(0);
							HtmlDivision td0Div1 = (HtmlDivision) td0.getElementsByTagName("div").get(1);
							HtmlSpan td0Div1Span = (HtmlSpan) td0Div1.getElementsByTagName("span").get(0);
							HtmlInput td0Div1SpanInput = (HtmlInput) td0Div1Span.getElementsByTagName("input").get(0);
							String cangWeiJiaGeId = td0Div1SpanInput.getAttribute("id");
							String cangWeiJiaGe = td0Div1Span.getTextContent();
							HtmlElement td1 = yxp1Tr.getElementsByTagName("td").get(1);
							HtmlElement td2 = yxp1Tr.getElementsByTagName("td").get(2);
							HtmlElement td3 = yxp1Tr.getElementsByTagName("td").get(3);
							HtmlElement td4 = yxp1Tr.getElementsByTagName("td").get(4);
							HtmlElement td5 = yxp1Tr.getElementsByTagName("td").get(5);
							String changeTimeBefore = td1.getTextContent();
							String changeTimeAfter = td2.getTextContent();
							String refundTimeBefore = td3.getTextContent();
							String refundTimeAfter = td4.getTextContent();
							String ziYuan = td5.getTextContent();
							
							changed3ChangeInfoYxp.setXcobxId(xcobxId);
							changed3ChangeInfoYxp.setCangWeiJiaGeId(cangWeiJiaGeId);
							changed3ChangeInfoYxp.setCangWeiJiaGe(cangWeiJiaGe);
							changed3ChangeInfoYxp.setChangeTimeBefore(changeTimeBefore);
							changed3ChangeInfoYxp.setChangeTimeAfter(changeTimeAfter);
							changed3ChangeInfoYxp.setRefundTimeBefore(refundTimeBefore);
							changed3ChangeInfoYxp.setRefundTimeAfter(refundTimeAfter);
							changed3ChangeInfoYxp.setZiYuan(ziYuan);
							changed3ChangeYxpList.add(changed3ChangeInfoYxp);
						}
						changeFlihgtEW.setChanged3ChangeYxpList(changed3ChangeYxpList);				}
					
					HtmlTableBody klf1Tbody = (HtmlTableBody) showmxTable.getElementsByTagName("tbody").get(6);
					DomNodeList<HtmlElement> klf1Trs = klf1Tbody.getElementsByTagName("tr");
					if(klf1Trs.size() != 0) {
						for (int i1 = 0; i1 < klf1Trs.size(); i1++) {
							Changed3ChangeInfo changed3ChangeInfoKlf = new Changed3ChangeInfo();
							HtmlElement klf1Tr = klf1Trs.get(i1);
							HtmlElement td0 = klf1Tr.getElementsByTagName("td").get(0);
							HtmlDivision td0Div1 = (HtmlDivision) td0.getElementsByTagName("div").get(1);
							HtmlSpan td0Div1Span = (HtmlSpan) td0Div1.getElementsByTagName("span").get(0);
							HtmlInput td0Div1SpanInput = (HtmlInput) td0Div1Span.getElementsByTagName("input").get(0);
							String cangWeiJiaGeId = td0Div1SpanInput.getAttribute("id");
							String cangWeiJiaGe = td0Div1Span.getTextContent();
							HtmlElement td1 = klf1Tr.getElementsByTagName("td").get(1);
							HtmlElement td2 = klf1Tr.getElementsByTagName("td").get(2);
							HtmlElement td3 = klf1Tr.getElementsByTagName("td").get(3);
							HtmlElement td4 = klf1Tr.getElementsByTagName("td").get(4);
							HtmlElement td5 = klf1Tr.getElementsByTagName("td").get(5);
							String changeTimeBefore = td1.getTextContent();
							String changeTimeAfter = td2.getTextContent();
							String refundTimeBefore = td3.getTextContent();
							String refundTimeAfter = td4.getTextContent();
							String ziYuan = td5.getTextContent();
							
							changed3ChangeInfoKlf.setXcobxId(xcobxId);
							changed3ChangeInfoKlf.setCangWeiJiaGeId(cangWeiJiaGeId);
							changed3ChangeInfoKlf.setCangWeiJiaGe(cangWeiJiaGe);
							changed3ChangeInfoKlf.setChangeTimeBefore(changeTimeBefore);
							changed3ChangeInfoKlf.setChangeTimeAfter(changeTimeAfter);
							changed3ChangeInfoKlf.setRefundTimeBefore(refundTimeBefore);
							changed3ChangeInfoKlf.setRefundTimeAfter(refundTimeAfter);
							changed3ChangeInfoKlf.setZiYuan(ziYuan);
							changed3ChangeKlfList.add(changed3ChangeInfoKlf);
						}
						changeFlihgtEW.setChanged3ChangeKlfList(changed3ChangeKlfList);
					}
					changeFlihgtEWList.add(changeFlihgtEW);
					
				}
				m++;
			}
	
			HtmlDivision hangChengDiv = (HtmlDivision) page3.getBody().getElementsByAttribute("div", "class", "xtlb newlc").get(i);
			HtmlTable table = (HtmlTable) hangChengDiv.getElementsByTagName("table").get(0);
			String hangCheng = table.asXml();
			
			HtmlDivision hpinfoDiv = (HtmlDivision) page3.getBody().getElementsByAttribute("div", "class", "ncpbox hpinfo").get(i);
			HtmlTable hpinfoTable = (HtmlTable) hpinfoDiv.getElementsByTagName("table").get(0);
			String hpinfoTableXML = hpinfoTable.asXml();
			
			changeFlihgtHB.setXcobxId(xcobxId);
			changeFlihgtHB.setChangeFlihgtEWLists(changeFlihgtEWList);
			changeFlihgtHB.setHangCheng(hangCheng);
			changeFlihgtHB.setHpinfoTableXML(hpinfoTableXML);
			changeFlihgtHBList.add(changeFlihgtHB);
		}
		map.put("changeFlihgtHBList", changeFlihgtHBList);
		session.setAttribute("page33", page3);
		
		return map;
	}

	/**
	 * 变更页面change3航班信息
	 */
	@Override
	public Map<String, Object> change3ChangeFlightInfo(String id,String mark, HttpSession session) {
		scl.change3 = null;
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page33 = (HtmlPage) session.getAttribute("page33");
		HtmlInput idInput = (HtmlInput) page33.getElementById(id);
		clickHandler(idInput);
		for (int i = 0; i < 5; i++) {
			if(scl.change3 != null) {
				HtmlDivision xcobxDiv = (HtmlDivision) page33.getElementById(mark);
				HtmlDivision hpinfoDiv = (HtmlDivision) xcobxDiv.getElementsByAttribute("div", "class", "ncpbox hpinfo").get(0);
				HtmlTable hpinfoTable = (HtmlTable) hpinfoDiv.getElementsByTagName("table").get(0);
				map.put("hpinfoTable", hpinfoTable.asXml());
				break;
			}
			synchronized (page33) {
				try {
					page33.wait(200);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				log.info("等待变更......");
			}
		}
		
		return map;
	}

	/**
	 * 变更change3点击下一步
	 */
	@Override
	public Map<String, Object> change3Next( HttpSession session) {
		alertMessage = null;
		confirmMessage = null;
		scl.change3 = null;
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page33 = (HtmlPage) session.getAttribute("page33");
//		HtmlInput radio1IdInput = (HtmlInput) page3.getElementById(radio1Id);
//		clickHandler(radio1IdInput);
//		for (int i = 0; i < 1; i++) {
//			synchronized (page3) {
//				try {
//					page3.wait(1000);
//				} catch (InterruptedException e) {
//					e.printStackTrace();
//				}
//			}
//		}
//		HtmlInput radio2IdInput = (HtmlInput) page3.getElementById(radio2Id);
//		clickHandler(radio2IdInput);
		HtmlAnchor bluebtnsty = (HtmlAnchor) page33.getBody().getElementsByAttribute("a", "class", "bluebtnsty").get(0);
		HtmlSpan span = (HtmlSpan) bluebtnsty.getElementsByTagName("span").get(0);
		HtmlPage page4 = clickHandler(span);
		for (int i = 0; i < 5; i++) {
			if(scl.change3 != null) {
				if(confirmMessage != null) {
					map.put("msg", confirmMessage);
					return map;
				}
				if(alertMessage != null) {
					map.put("msg", alertMessage);
					return map;
				}
				break;
			}
			synchronized (page33) {
				try {
					page33.wait(200);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("等待change3下一步.......");
			}
		}
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlSpan totalPaymentSpan = (HtmlSpan) page4.getElementById("totalPayment");
			if(totalPaymentSpan != null) {
				String totalPayment = totalPaymentSpan.asText().trim();
				log.info("totalPayment======>"+totalPayment);
				if(totalPayment != "") {
					map.put("notice", "true");
					session.setAttribute("page4", page4);
					return map;
				}
			}
			synchronized (page4) {
				try {
					page4.wait(200);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("等待change4......");
			}
		}
		map.put("msg", "该机票已进行了退票或变更操作！");
		return map;
	}

	/**
	 * 加载变更页面4
	 */
	@Override
	public Map<String, Object> loadChange4(HttpSession session) {
		Map<String, Object> map = new HashMap<String ,Object>();
		HtmlPage page4 = (HtmlPage) session.getAttribute("page4");
		HtmlSpan totalPaymentSpan = (HtmlSpan) page4.getElementById("totalPayment");
		map.put("totalPayment", totalPaymentSpan.asText());
		
		List<Change4ChangeInfo> change4ChangeInfoList = new ArrayList<Change4ChangeInfo>();
		HtmlDivision pxbo0Div = (HtmlDivision) page4.getBody().getElementsByAttribute("div", "class", "pxbo").get(0);
		DomNodeList<HtmlElement> pxbo0DivTrs = pxbo0Div.getElementsByTagName("tr");
		for (int i = 1; i < pxbo0DivTrs.size(); i++) {
			Change4ChangeInfo change4ChangeInfo = new Change4ChangeInfo();
			HtmlElement pxbo0DivTr = pxbo0DivTrs.get(i);
			DomNodeList<HtmlElement> pxbo0DivTrTds = pxbo0DivTr.getElementsByTagName("td");
			change4ChangeInfo.setXuHao(pxbo0DivTrTds.get(0).asText());
			change4ChangeInfo.setChangeDateBefore(pxbo0DivTrTds.get(1).asText());
			change4ChangeInfo.setHangBanHaoBefore(pxbo0DivTrTds.get(2).asText());
			change4ChangeInfo.setCangWeiBefore(pxbo0DivTrTds.get(3).asText());
			change4ChangeInfo.setChangeDateAfter(pxbo0DivTrTds.get(4).asText());
			change4ChangeInfo.setHangBanHaoAfter(pxbo0DivTrTds.get(5).asText());
			change4ChangeInfo.setCangWeiAfter(pxbo0DivTrTds.get(6).asText());
			change4ChangeInfoList.add(change4ChangeInfo);
		}
		map.put("change4ChangeInfoList", change4ChangeInfoList);
		
		List<Change4ChangePayInfo> change4ChangePayInfoList = new ArrayList<Change4ChangePayInfo>();
		HtmlDivision pxbo1Div = (HtmlDivision) page4.getBody().getElementsByAttribute("div", "class", "pxbo").get(1);
		DomNodeList<HtmlElement> pxbo1DivTrs = pxbo1Div.getElementsByTagName("tr");
		for (int i = 1; i < pxbo1DivTrs.size(); i++) {
			Change4ChangePayInfo change4ChangePayInfo = new Change4ChangePayInfo();
			HtmlElement pxbo1DivTr = pxbo1DivTrs.get(i);
			DomNodeList<HtmlElement> pxbo1DivTrTds = pxbo1DivTr.getElementsByTagName("td");
			change4ChangePayInfo.setXuHao(pxbo1DivTrTds.get(0).asText());
			change4ChangePayInfo.setpType(pxbo1DivTrTds.get(1).asText());
			change4ChangePayInfo.setChangePay(pxbo1DivTrTds.get(2).asText());
			change4ChangePayInfo.setPiaoJiaCha(pxbo1DivTrTds.get(3).asText());
			change4ChangePayInfo.setRanYouFeiChaJia(pxbo1DivTrTds.get(4).asText());
			change4ChangePayInfo.setJiChangShuiChaJia(pxbo1DivTrTds.get(5).asText());
			change4ChangePayInfo.setCount(pxbo1DivTrTds.get(6).asText());
			change4ChangePayInfo.setTotle(pxbo1DivTrTds.get(7).asText());
			change4ChangePayInfoList.add(change4ChangePayInfo);
		}
		map.put("change4ChangePayInfoList", change4ChangePayInfoList);
		
		return map;
	}

	/**
	 * change4点击下一步
	 */
	@Override
	public Map<String, Object> change4Next(HttpSession session) {
		scl.getChangeNo = null;
		alertMessage = null;
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page4 = (HtmlPage) session.getAttribute("page4");
		HtmlAnchor bluebtnsty = (HtmlAnchor) page4.getBody().getElementsByAttribute("a", "class", "bluebtnsty").get(0);
		HtmlSpan span = (HtmlSpan) bluebtnsty.getElementsByTagName("span").get(0);
		clickHandler(span);
		for (int i = 0; i < timeoutmax; i++) {
			if(scl.getChangeNo != null) {
				if(alertMessage != null) {
					map.put("notice", "false");
					map.put("msg", alertMessage);
					return map;
				}
				String getChangeNo = scl.getChangeNo;
				String changeNo = getChangeNo.substring(getChangeNo.length()-14,getChangeNo.length());
				log.info("changeNo====>"+changeNo);
				map.put("changeNo", changeNo);
				map.put("notice", "true");
				return map;
			}
			synchronized (page4) {
				try {
					page4.wait(300);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("获取changeNo........");
			}
		}
		map.put("notice", "false");
		map.put("msg", "变更单号获取超时！");
		return map;
	}


	/**
	 * 加载变更支付页
	 */
	@Override
	public Map<String, Object> payForChange(String changeNo) {
		Map<String, Object> map = new HashMap<String, Object>();
		String URLChangePay = "http://b2c.csair.com/B2C40/uppPayment/channel/pay.ao?changeNo=" + changeNo;
		for (int i = 0; i <= timeoutmax; i++) {
			changePaymentPage = webClient.getCsairHtmlPage(URLChangePay, "URLChangePay", false);
			if (changePaymentPage.isNull() == false) {
				break;
			}
		}
		HtmlPage page = changePaymentPage.getHtmlPage();
		for (int i = 0; i <= timeoutmax; i++) {
			if (page.getElementById("payMoney") != null) {
				String payMoney = page.getElementById("payMoney").asText();
				map.put("payMoney", payMoney);
				
				map.put("changeNo", changeNo);
				
				HtmlElement headTitleXQ0 = page.getBody().getElementsByAttribute("b", "class", "headTitleXQ").get(0);
				String shouFeiFang = headTitleXQ0.asText();
				map.put("shouFeiFang", shouFeiFang);
				
				HtmlElement headTitleXQ1 = page.getBody().getElementsByAttribute("b", "class", "headTitleXQ").get(1);
				String shangPinXinXi = headTitleXQ1.asText();
				map.put("shangPinXinXi", shangPinXinXi);
				
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {

					e.printStackTrace();
					changePaymentPage.setLS(CS.FAIL);
					log.info(changePaymentPage.getLS());
				}
				changePaymentPage.setLS(CS.LOADING);
				log.info(changePaymentPage.getLS());
			}
		}
		return map;
	}


	/**
	 * 变更单支付页面借记卡获取验证码
	 */
	@Override
	public CsairReturnValue payChangeYzm(String accountNo, String buyerName, String idCard, String mobile) {
		scl.payYzm = null;
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = changePaymentPage.getHtmlPage();
		List<HtmlElement> hes = page.getBody().getElementsByAttribute("ul","class", "pay-way-list");
		HtmlElement he;
		if(hes.size() != 0) {
			he = hes.get(0);
			DomNodeList<HtmlElement> lis = he.getElementsByTagName("li");
			for (int i1 = 0; i1 < lis.size(); i1++) {
				HtmlElement li = lis.get(i1);
				if(li.asText().contains("快捷支付")) {
					clickHandler(he);
					break;
				}
			}
		}
			
		
		
//		HtmlUnorderedList ul = (HtmlUnorderedList) page.getElementById("Credit_Card_Payment ");
//		orderPaymentPage.setParent(ul);
		for (int i = 0; i < timeoutmax; i++) {
			if(scl.couponRemarkLoad != null) {
//				HtmlInput borrowCardRadio = (HtmlInput) page.getElementById("borrowCard");
				page.executeJavaScript("$('#borrowCard').click();");

				HtmlInput accountNoInput = (HtmlInput) page.getElementById("ACCOUNTNO");
				accountNoInput.focus();
				accountNoInput.setValueAttribute(accountNo);
				accountNoInput.blur();
//				page.executeJavaScript("$('#ACCOUNTNO').focus();");
//				StringBuilder js = new StringBuilder();
//			    js.append("$('#ACCOUNTNO').attr('value':'").append(accountNo).append("');");
//	 			page.executeJavaScript(js.toString());  
//				page.executeJavaScript("$('#ACCOUNTNO').blur();");

				HtmlInput buyerNameInput = (HtmlInput) page.getElementById("BUYERNAME");
				buyerNameInput.setValueAttribute(buyerName);

				HtmlInput idCardInput = (HtmlInput) page.getElementById("IDCARD");
				idCardInput.setValueAttribute(idCard);

				HtmlInput mobileInput = (HtmlInput) page.getElementById("MOBILE");
				mobileInput.setValueAttribute(mobile);

				HtmlElement h4 = page.getBody().getElementsByAttribute("h4", "class", "payment-title").get(0);
				String changeNo = h4.getElementsByTagName("b").get(0).asText();
				log.info("changeNo====>"+changeNo);
//				HtmlInput codeButton = (HtmlInput) page.getBody().getElementsByAttribute("input", "class", "creditPaySendCode").get(0);
//				log.info(codeButton.asXml());
//				clickHandler(codeButton);
//				log.info("===============================================================================");
//				log.info(codeButton.asXml());
				
		        page.executeJavaScript("$('.creditPaySendCode').click();");
		        HtmlInput creditChannelId = (HtmlInput) page.getElementById("creditChannelId");
		        log.info("creditChannelId====>"+creditChannelId.asXml());
		       
//		        url = "/upp_payment/mobileSyt/epay/sendCode.upp";
// 				data={'phone':phone,'lang':lang,'orderNo':orderNo,'sendTypeFlag':creditChannelId,'ACCOUNTNO':ACCOUNTNO}; 
				
//		        StringBuilder js1 = new StringBuilder();
//		        js1.append("$.ajax({type: 'POST',cache: false,url: '/upp_payment/mobileSyt/epay/sendCode.upp', data: {'phone':'14745759024','lang':'ZH_CN','orderNo':'").append(changeNo).append("','sendTypeFlag':'229','ACCOUNTNO':'6217001140033361624'},success: function(data){}});");
// 				page.executeJavaScript(js1.toString());  
 
//		        String str ="$.ajax({type: 'POST',cache: false,url: '/upp_payment/mobileSyt/epay/sendCode.upp', data: {'phone':'14745759024','lang':'ZH_CN','orderNo':'S1812050003722','sendTypeFlag':'250','ACCOUNTNO':'6217001140033361624'},success: function(data){}});";
 				break;
			}
			synchronized (page) {
				try {
					page.wait(1000);
					log.info("加载变更支付发送验证码文件.......");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
//		log.info(page.asXml());
	
		for (int i = 0; i <= timeoutmax; i++) {
			if (!"".equals(page.getElementById("phoneTips").asText().trim())) {
				log.info("----------加载验证信息------------------");
				String codeMsg = page.getElementById("phoneTips").asText().trim();
				returnValue.setMessage(codeMsg);
				return returnValue;
			}
			if(scl.payYzm != null) {
				returnValue.setMessage("发送验证码！");
				return returnValue;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {

					e.printStackTrace();
				}
				log.info("----------加载验证信息ing------------------");
			}
		}
		returnValue.setMessage("验证信息加载失败!!");
		log.info("验证信息加载失败!!");
		return returnValue;
	}


	/**
	 * 变更页面信用卡获取验证码
	 */
	@Override
	public CsairReturnValue xykPayChangeYzm(String accountNo, String eXPIREMONTH, String eXPIREYEAR, String cvv,
			String buyerName, String idCard, String mobile) {
//		log.info(accountNo+" "+eXPIREMONTH+" "+eXPIREYEAR+" "+cvv+" "+buyerName+" "+idCard+" "+mobile);
		scl.payYzm = null;
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = changePaymentPage.getHtmlPage();
		List<HtmlElement> hes = page.getBody().getElementsByAttribute("ul","class", "pay-way-list");
		HtmlElement he;
		if(hes.size() != 0) {
			he = hes.get(0);
			DomNodeList<HtmlElement> lis = he.getElementsByTagName("li");
			for (int i1 = 0; i1 < lis.size(); i1++) {
				HtmlElement li = lis.get(i1);
				if(li.asText().contains("快捷支付")) {
					clickHandler(he);
					break;
				}
			}
		}
		
//		HtmlUnorderedList ul = (HtmlUnorderedList) page.getElementById("Credit_Card_Payment ");
//		orderPaymentPage.setParent(ul);

		HtmlInput raCredit = (HtmlInput) page.getElementById("raCredit");
		clickHandler(raCredit);

		HtmlInput accountNoInput = (HtmlInput) page.getElementById("ACCOUNTNO");
		accountNoInput.setValueAttribute(accountNo);
		
		HtmlSelect expiremonthSelect = (HtmlSelect) page.getElementById("EXPIREMONTH");
		HtmlOption expiremonthOption = expiremonthSelect.getOptionByText(eXPIREMONTH);
		expiremonthOption.setSelected(true);
		
		HtmlSelect expireyearSelect = (HtmlSelect) page.getElementById("EXPIREYEAR");
		HtmlOption expireyearOption = expireyearSelect.getOptionByText(eXPIREYEAR);
		expireyearOption.setSelected(true);
		
		HtmlInput CVVInput = (HtmlInput) page.getElementById("CVV");
		CVVInput.setValueAttribute(cvv);

		HtmlInput buyerNameInput = (HtmlInput) page.getElementById("BUYERNAME");
		buyerNameInput.setValueAttribute(buyerName);

		HtmlInput idCardInput = (HtmlInput) page.getElementById("IDCARD");
		idCardInput.setValueAttribute(idCard);

		HtmlInput mobileInput = (HtmlInput) page.getElementById("MOBILE");
		mobileInput.setValueAttribute(mobile);

//		HtmlInput codeButton = (HtmlInput) page.getElementById("buttonForCode");
//		codeButton.removeAttribute("disabled");
//		clickHandler(codeButton);
		page.executeJavaScript("$('.creditPaySendCode').click();");
        HtmlInput creditChannelId = (HtmlInput) page.getElementById("creditChannelId");
        log.info("creditChannelId====>"+creditChannelId.asXml());
        
        
		for (int i = 0; i <= timeoutmax; i++) {
			if (!"".equals(page.getElementById("phoneTips").asText().trim()) ) {
				log.info("----------加载验证信息------------------");
				String codeMsg = page.getElementById("phoneTips").asText().trim();
				returnValue.setMessage(codeMsg);
				return returnValue;
			}
			if(scl.payYzm != null) {
				returnValue.setMessage("发送验证码！");
				return returnValue;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {

					e.printStackTrace();
				}
				log.info("----------加载验证信息ing------------------");
			}
		}
		returnValue.setMessage("验证信息加载失败!!");
		log.info("验证信息加载失败!!");
		return returnValue;
	}


	/**
	 * 变更单借记卡执行支付
	 */
	@Override
	public CsairReturnValue queryAndPayChange(String codeName) {
		scl.URLpayComplete = null;
		scl.URLpayErro = null;
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = changePaymentPage.getHtmlPage();
		try {
			Thread.sleep(200);
		} catch (InterruptedException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		HtmlDivision div = page.getFirstByXPath("//div[@class='credit1']");
//		log.info("div========>" + div.asXml());
		HtmlInput codeNameInput = (HtmlInput) page.getElementById("CODENAME"); // 验证码
		codeNameInput.setValueAttribute(codeName);

		HtmlInput payButton = page.getElementByName("upp_pay_btn"); // 执行支付按钮
		page = clickHandler(payButton);
		HtmlDivision popboxDiv = (HtmlDivision) page.getElementById("popbox");
		HtmlSpan alertSpan = (HtmlSpan) page.getBody().getElementsByAttribute("span", "class", "info2").get(0);
		HtmlDivision alertDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "infodt").get(0);
		for (int i = 0; i <= timeoutmax; i++) {
			if (!popboxDiv.getAttribute("class").contains("hide")) {
				returnValue.setMessage(alertSpan.asText() + "," + alertDiv.asText());
				log.info("alertDiv.asText()===>" + alertSpan.asText() + "," + alertDiv.asText());
				returnValue.setState(CS.FAIL);
				
				clickHandler(page.getElementById("btnsty1"));
				return returnValue;
			} else if (scl.URLpayComplete != null) {
				returnValue.setMessage("支付成功!");
				returnValue.setState(CS.SUCCESS);
				log.info("完成支付!!");
				return returnValue;
			} else if (scl.URLpayErro != null) {
				returnValue.setMessage("支付失败!");
				returnValue.setCheckmodel(Boolean.TRUE);
				log.info("支付失败!!");
				returnValue.setState(CS.FAIL);
				return returnValue;
			}

			synchronized (page) {
				try {
					page.wait(1000);
				} catch (InterruptedException e) {

					e.printStackTrace();
				}
				log.info("支付信息加载中........");
			}
		}
		returnValue.setMessage("支付失败");
		log.info("支付失败");
		returnValue.setState(CS.FAIL);
		return returnValue;
	}

	/**
	 * 变更单信用卡执行支付
	 */
	@Override
	public CsairReturnValue xykQueryAndPayChange(String codeName, String expiremonth, String expireyear) {
		scl.URLpayComplete = null;
		scl.URLpayErro = null;
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = changePaymentPage.getHtmlPage();
		try {
			Thread.sleep(200);
		} catch (InterruptedException e1) {
			e1.printStackTrace();
		}
		HtmlDivision div = page.getFirstByXPath("//div[@class='credit1']");
//		log.info("div========>" + div.asXml());
		HtmlInput codeNameInput = (HtmlInput) page.getElementById("CODENAME"); // 验证码
		codeNameInput.setValueAttribute(codeName);
		
		HtmlSelect expiremonthSelect = (HtmlSelect) page.getElementById("EXPIREMONTH");
		HtmlOption expiremonthOption = expiremonthSelect.getOptionByValue(expiremonth);
		expiremonthOption.setSelected(true);
		expiremonthOption.type(9);
		
		HtmlSelect expireyearSelect = (HtmlSelect) page.getElementById("EXPIREYEAR");
		HtmlOption expireyearOption = expireyearSelect.getOptionByValue(expireyear);
		expireyearOption.setSelected(true);
		expireyearOption.type(9);

		HtmlInput payButton = page.getElementByName("upp_pay_btn"); // 执行支付按钮
		page = clickHandler(payButton);
		HtmlDivision popboxDiv = (HtmlDivision) page.getElementById("popbox");
		HtmlSpan alertSpan = (HtmlSpan) page.getBody().getElementsByAttribute("span", "class", "info2").get(0);
		HtmlDivision alertDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "infodt").get(0);
		for (int i = 0; i <= timeoutmax; i++) {
			if (!popboxDiv.getAttribute("class").contains("hide")) {
				returnValue.setMessage(alertSpan.asText() + "," + alertDiv.asText());
				log.info("alertDiv.asText()===>" + alertSpan.asText() + "," + alertDiv.asText());
				returnValue.setState(CS.FAIL);
				
				clickHandler(page.getElementById("btnsty1"));
				return returnValue;
			} else if (scl.URLpayComplete != null) {
				returnValue.setMessage("支付成功!");
				returnValue.setState(CS.SUCCESS);
				log.info("完成支付!!");
				return returnValue;
			} else if (scl.URLpayErro != null) {
				returnValue.setMessage("支付失败!");
				returnValue.setCheckmodel(Boolean.TRUE);
				log.info("支付失败!!");
				returnValue.setState(CS.FAIL);
				return returnValue;
			}

			synchronized (page) {
				try {
					page.wait(1000);
				} catch (InterruptedException e) {

					e.printStackTrace();
				}
				log.info("支付信息加载中........");
			}
		}
		returnValue.setMessage("支付失败");
		log.info("支付失败");
		returnValue.setState(CS.FAIL);
		return returnValue;

	}

	/**
	 * 里程兑换支付页面加载
	 */
	@Override
	public Map<String, Object> loadLCPayFilightInfo(String orderNo) {
		log.info("orderNo===>"+orderNo);
		Map<String, Object> map = new HashMap<String, Object>();
		if (orderNo == null || orderNo.equals("")) {
			log.error("订单号为空，中断跳转到支付页面");
			return null;
		}
		String URLLCOrderPay = Csair.URLpay + "?orderNo=" + orderNo;
		for (int i = 0; i <= timeoutmax; i++) {
			orderLCPaymentPage = webClient.getCsairHtmlPage(URLLCOrderPay, "URLLCOrderPay", false);
			// log.info("------------------------------------------------------------------");
			// log.info("orderPaymentPage==>"+orderPaymentPage.getHtmlPage());
			// log.info("orderPaymentPage==>"+orderPaymentPage.getHtmlPage().asXml());
			// log.info("------------------------------------------------------------------");
			if (orderLCPaymentPage.isNull() == false) {
				break;
			}
		}
		HtmlPage page = orderLCPaymentPage.getHtmlPage();
		for (int i = 0; i < timeoutmax; i++) {
			log.info("i=====>"+i);
			if (page.getElementById("payMoney") != null) {
//				long t2 = System.currentTimeMillis();
//				log.info("================================================================");
//				double nanhangTime3 = (t2-t1)/1000.0;
//				map.put("nanhangTime3", nanhangTime3);
				orderLCPaymentPage.setLS(CS.SUCCESS);
				log.info(orderLCPaymentPage.getLS() + "支付页面加载成功!!!");
				List<FlightPayInfo> flightPayInfoList = new ArrayList<FlightPayInfo>();
				HtmlTable flightInfoTable = (HtmlTable) page.getElementById("flight-info");
				DomNodeList<HtmlElement> flightInfoTableTrs = flightInfoTable.getElementsByTagName("tr");
				for (int j = 0; j < flightInfoTableTrs.size(); j++) {
					FlightPayInfo flightPayInfo = new FlightPayInfo();
					
					flightPayInfo.setPayOrderNo(orderNo);
					
					HtmlElement flightInfoTableTr = flightInfoTableTrs.get(j);
					HtmlElement flightTypeTd = flightInfoTableTr.getElementsByAttribute("td", "class", "flight-type newFlightType").get(0);
					String flightType = flightTypeTd.asText();
					flightPayInfo.setFlightType(flightType);
					
					HtmlElement ticketNumTd = flightInfoTableTr.getElementsByAttribute("td", "class", "ticketNum").get(0);
					String ticketNum = ticketNumTd.asText();
					flightPayInfo.setFlightCabin(ticketNum);
					
					HtmlDivision tripTimeDiv = (HtmlDivision) flightInfoTableTr.getElementsByAttribute("div", "class", "tripTime").get(0);
					String tripTime = tripTimeDiv.asText();
					flightPayInfo.setSendTime(tripTime);
					
					HtmlDivision tripPlaceDiv = (HtmlDivision) flightInfoTableTr.getElementsByAttribute("div", "class", "tripPlace").get(0);
					String tripPlace = tripPlaceDiv.asText();
					flightPayInfo.setFlightCity1(tripPlace);
					
					HtmlDivision tripDateDiv = (HtmlDivision) flightInfoTableTr.getElementsByAttribute("div", "class", "tripDate").get(0);
					String tripDate = tripDateDiv.asText();
					flightPayInfo.setFlightDate(tripDate);
					
					HtmlDivision tripTimeDiv1 = (HtmlDivision) flightInfoTableTr.getElementsByAttribute("div", "class", "tripTime").get(1);
					String tripTime1 = tripTimeDiv1.asText();
					flightPayInfo.setArriveTime(tripTime1);
					
					HtmlDivision tripPlaceDiv1 = (HtmlDivision) flightInfoTableTr.getElementsByAttribute("div", "class", "tripPlace").get(1);
					String tripPlace1 = tripPlaceDiv1.asText();
					flightPayInfo.setFlightCity2(tripPlace1);
					
					HtmlElement flightSeatTypeTd = flightInfoTableTr.getElementsByAttribute("td", "class", "flightSeatType").get(0);
					String flightSeatType = flightSeatTypeTd.asText();
					flightPayInfo.setFlightCabinLevel(flightSeatType);
					
					flightPayInfoList.add(flightPayInfo);
				}
				map.put("flightPayInfoList", flightPayInfoList);
				
				HtmlTable psgInfoTable = (HtmlTable) page.getElementById("psg-info");
				HtmlElement psgInfoTableTr = psgInfoTable.getElementsByTagName("tr").get(0);
				HtmlElement infoNameTd = psgInfoTableTr.getElementsByAttribute("td", "class", "info-name newInfoName").get(0);
				String infoName = infoNameTd.getElementsByTagName("b").get(0).asText();
				map.put("infoName", infoName);
				
				HtmlSpan psgTypeSpan = (HtmlSpan) psgInfoTableTr.getElementsByAttribute("span", "class", "newMassagerOld").get(0);
				String psgType = psgTypeSpan.asText();
				map.put("psgType", psgType);
				
				HtmlElement cardNumTd = psgInfoTableTr.getElementsByTagName("td").get(3);
				String cardNum = cardNumTd.getElementsByTagName("b").get(0).asText();
				map.put("cardNum", cardNum);
				
				HtmlElement lianxirenB = (HtmlElement) page.getElementById("lianxiren");
				String lianxiren = lianxirenB.asText();
				map.put("lianxiren", lianxiren);
				
				HtmlSpan lianxirenPhoneSpan = (HtmlSpan) page.getElementById("lianxirenPhone");
				String lianxirenPhone = lianxirenPhoneSpan.getElementsByTagName("b").get(0).asText();
				map.put("lianxirenPhone", lianxirenPhone);
				
				HtmlSpan lianxirenEmailSpan = (HtmlSpan) page.getElementById("lianxirenEmail");
				String lianxirenEmail = lianxirenEmailSpan.getElementsByTagName("b").get(0).asText();
				map.put("lianxirenEmail", lianxirenEmail);
				
				HtmlSpan totalMileageSpan = (HtmlSpan) page.getElementById("totalMileage");
				String totalMileage = totalMileageSpan.asText();
				map.put("totalMileage", totalMileage);
				
				HtmlSpan payMoneySpan = (HtmlSpan) page.getElementById("payMoney");
				String payMoney = payMoneySpan.asText();
				map.put("payMoney", payMoney);
				
//				long t3 = System.currentTimeMillis();
//				double chuliTime3 = (t3-t2)/1000.0;
//				map.put("chuliTime3", chuliTime3);
//				log.info("无障碍页面加载成功，无障碍处理用时"+chuliTime3+"s");
//				log.info("支付页面共用时"+(t3-t1)/1000.0+"s");

				return map;
			}
			if (page.getElementById("pay-status") != null) {
				FlightPayInfo fpi = new FlightPayInfo();
				fpi.setPayOrderNo(null);
				map.put("fpi", fpi);
				return map;
			}

			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
					orderLCPaymentPage.setLS(CS.FAIL);
					log.info(orderLCPaymentPage.getLS());
				}
				orderLCPaymentPage.setLS(CS.LOADING);
				log.info("里程兑换支付页面加载状态=====>"+orderLCPaymentPage.getLS());
			}
		}
		log.info("里程兑换支付页面加载状态=====>循环结束！");
		return map;
	}

	
	
	
	/**
	 * 航班页点击日历
	 * @param week
	 * @param c1
	 * @param c2
	 * @param year
	 * @param month
	 * @param day
	 * @param day2 
	 * @param month2 
	 * @param year2 
	 * @return
	 */
	public Map<String, Object> flightQueryEx(String week, String c1, String c2, String year, String month, String day, String year2, String month2, String day2) {
		Map<String, Object> map = new HashMap<String, Object>();
		List<Flight> flights = new ArrayList<Flight>();
		HtmlPage page = flightQueryPage.getHtmlPage();
		HtmlElement he = page.getFirstByXPath("//li[@data-date='" + week + "']");
		clickHandler(he);
		for (int j = 0; j <= timeoutmax; j++) {
			HtmlDivision alert_error = page.getFirstByXPath("//div[@class='alert-info alert-error']");
			if (alert_error != null) {
				map.put("cf", c1);
				map.put("dd", c2);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				HtmlDivision qc = page.getFirstByXPath("//div[@class='flightTcity']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='flightTTime']");
				map.put("qc", qc.asText());// 全程
				map.put("rq", rq.asText());// 日期

				HtmlDivision lk = page.getFirstByXPath("//div[@class='flightTdata']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span.spaceO");
				String adult = lkelments.get(0).text();
				String child = lkelments.get(1).text();
				String baby = lkelments.get(2).text();
				map.put("adult", adult);
				map.put("child", child);
				map.put("baby", baby);
				map.put("noflight", alert_error.asText());
				return map;
			}
			HtmlDivision div = page.getFirstByXPath("//div[@class='sp-trip-body']");
			if (div != null) {
				map.put("cf", c1);
				map.put("dd", c2);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				HtmlDivision qc = page.getFirstByXPath("//div[@class='flightTcity']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='flightTTime']");
				map.put("qc", qc.asText());
				map.put("rq", rq.asText());

				HtmlDivision lk = page.getFirstByXPath("//div[@class='flightTdata']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span.spaceO");
				String adult = lkelments.get(0).text();
				String child = lkelments.get(1).text();
				String baby = lkelments.get(2).text();
				map.put("adult", adult);
				map.put("child", child);
				map.put("baby", baby);
				Document document = Jsoup.parse(div.asXml());
				Elements elements = document.select("div.sp-trip-body ul");
				for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
					Element element = (Element) iterator.next();
					Flight f = new Flight();
					Elements lis = element.select("li");
					Element item0 = lis.get(0);
					if (item0 != null) {
						Element doc = item0;
						// 起飞时间
						f.qf_time = doc.select("div.sp-trip-time").get(0).text().trim();
						// 起飞城市
						f.qf_city = doc.select("div.sp-trip-city").get(0).text().trim();
						// 到达时间
						f.dd_time = doc.select("div.sp-trip-time").get(1).text().trim();
						// 到达城市
						f.dd_city = doc.select("div.sp-trip-city").get(1).text().trim();
						// 航班号
						f.hbh = doc.select("div.sp-trip-stops").get(0).text().trim();
						// 飞机型号
						f.jx = doc.select("div.sp-trip-duration").get(0).text().trim();
					}
					Element item1 = lis.get(1);
					if (item1 != null) {
						Element doc = item1;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f.tdc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f.tdc_href = el.attr("href");
						}
					}

					Element item2 = lis.get(2);
					if (item2 != null) {
						Element doc = item2;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f.gwc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f.gwc_href = el.attr("href");
						}
					}

					Element item3 = lis.get(3);
					if (item3 != null) {
						Element doc = item3;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f.mzjjc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f.mzjjc_href = el.attr("href");
						}

					}
					Element item4 = lis.get(4);
					if (item4 != null) {
						Element doc = item4;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f.jjc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f.jjc_href = el.attr("href");
						}
						if (els.isEmpty()) {
							f.jjc = doc.html();
						}
					}

//					log.info(f);
					flights.add(f);
				}
				map.put("flights", flights);
				flightQueryPage.setLS(CS.SUCCESS);
				log.info(flightQueryPage.getLS());
				break;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {

					e.printStackTrace();
				}
			}
		}
		for (int j = 0; j <= timeoutmax; j++) {
			HtmlDivision rls = page.getFirstByXPath("//div[@class='flightweek clearfix zh']");
			List<Kalendar> kalendars = new ArrayList<Kalendar>();
			if (rls != null) {
				Document document = Jsoup.parse(rls.asXml());
				Elements elements = document.select("ul li");
				for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
					Element li = (Element) iterator.next();
					Kalendar k = new Kalendar();
					k.id = li.attr("data-date").trim();
//					log.info("cls:" + k.id);
					String cls = li.attr("class");
					if (cls != null && cls.trim().equals("") != true) {
						k.current = cls.trim();
					}
					k.week = li.select("a.weekBtn").get(0).ownText();
					k.date = li.select("span.spaceO").get(0).ownText();
					k.price = li.select("div.weekprice").get(0).ownText();
//					log.info(k);
					kalendars.add(k);
				}
				map.put("kalendars", kalendars);
				break;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {

					e.printStackTrace();
				}
			}
		}
		return map;
	}
	
	/**
	 *返程日历1，点击出发日期变更
	 * @param week
	 * @param c1
	 * @param c2
	 * @param year
	 * @param month
	 * @param day
	 * @param year2
	 * @param month2
	 * @param day2
	 * @param mark 
	 * @return
	 */
	public Map<String, Object> flightQueryEx1(String week, String c1, String c2, String year, String month, String day, String year2, String month2, String day2, String mark) {
		log.info("mark======>"+mark);
		Map<String, Object> map = new HashMap<String, Object>();
		List<Flight> flights = new ArrayList<Flight>();
		List<Flight2> flights2 = new ArrayList<Flight2>();
		HtmlPage page = flightQueryPage.getHtmlPage();
		HtmlElement he = page.getFirstByXPath("//li[@data-date='" + week + "']");
		clickHandler(he);
		for (int j = 0; j <= timeoutmax; j++) {
			HtmlDivision alert_error = page.getFirstByXPath("//div[@class='alert-info alert-error']");
			HtmlDivision alert_error1 = page.getFirstByXPath("//div[@class='alertinfo-error']");
			if (alert_error != null || alert_error1!= null) {
				map.put("cf", c1);
				map.put("dd", c2);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);
	
				HtmlDivision qc = page.getFirstByXPath("//div[@class='flightTcity']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='flightTTime']");
				
				map.put("qc", qc.asText());// 全程
				map.put("rq", rq.asText());// 日期
	
				HtmlDivision lk = page.getFirstByXPath("//div[@class='flightTdata']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span.spaceO");
				String adult = lkelments.get(0).text();
				String child = lkelments.get(1).text();
				String baby = lkelments.get(2).text();
				map.put("adult", adult);
				map.put("child", child);
				map.put("baby", baby);
				if(alert_error != null){
					map.put("noflight", alert_error.asText());
				}
				if(alert_error1 != null){
					map.put("noflight1", alert_error1.asText());
				}
				return map;
			}
			
			//判断是否有往返程中的单程明细
			if(mark.equals("1")) {
				for (int i = 0; i <= timeoutmax; i++) {
					log.info("第"+(i+1)+"次进入循环");
					List<HtmlElement> selectedFlight = page.getBody().getElementsByAttribute("div", "class", "selectedflight");
					log.info("selectedFlight.size()===>"+selectedFlight.size());
					if(selectedFlight.size() != 0) {
						try {
							Thread.sleep(5000);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						HtmlDivision selectedFlightDiv = (HtmlDivision) selectedFlight.get(0);
						Document doc = Jsoup.parse(selectedFlightDiv.asXml());
						Elements divs = doc.select("div.selectedlist .selectedinfo");
						FlightInfo flightInfo1 = new FlightInfo();
						Element cfcityDiv = divs.get(0);
						Element cfcity = cfcityDiv.select(".selectedcity").get(0);
						flightInfo1.qf_city = cfcity.select("span").get(0).ownText();// 起飞城市
						flightInfo1.qf_time = cfcity.select("span").get(1).ownText();// 起飞时间flight-date
						flightInfo1.qf_date = cfcityDiv.ownText();// 起飞时间
						Element hbhDiv = doc.select("div.selectedlist .selectedcabin").get(0);
						flightInfo1.hbh = hbhDiv.ownText();
						Element ddcityDiv = divs.get(1);
						Element ddcity = ddcityDiv.select(".selectedcity").get(0);
						flightInfo1.dd_city = ddcity.select("span").get(0).ownText();// 到达城市
						flightInfo1.dd_time = ddcity.select("span").get(1).ownText();// 到达时间
						flightInfo1.dd_date = ddcityDiv.ownText();// 到达时间
						Element selectedCon = doc.select(".selectedCon").get(0);
						flightInfo1.cx = selectedCon.select(".selectedtype").get(0).text();
						
						// 概述完成
						FlightInfo flightInfo = new FlightInfo();
						Element selectedcost = doc.select("div.selectedcost").get(0);
						Elements subDivs = selectedcost.select(".selectedcostCon");
						log.info("subDivs.size=====>"+subDivs.size());
						for (int k = 0; k < subDivs.size(); k++) {
							Element subDiv = subDivs.get(k);
							Element subUl = subDiv.select("ul").get(0);
							flightInfo.infos[k].lk = subUl.select("li").get(0).text();
							flightInfo.infos[k].pj = subUl.select("li").get(1).text();
							flightInfo.infos[k].ryf = subUl.select("li").get(2).text();
							flightInfo.infos[k].jcs = subUl.select("li").get(3).text();
							flightInfo.infos[k].bxf = subUl.select("li").get(4).text();
						}
						flightInfo.total = doc.select("div.totalCost").get(0).text();
						map.put("flightInfo1", flightInfo1);
						map.put("flightInfo", flightInfo);
						map.put("mark", "1");
						map.put("display1", "block;");
						map.put("display2", "none;");
						break;
					}
					synchronized (page) {
						try {
							page.wait(200);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						log.info("返回订票信息中。。。。。。。");
					}
				}
			}else {
				map.put("display0", "none;");
				map.put("mark", "2");
			}
			
			
			List<HtmlElement> divs = page.getBody().getElementsByAttribute("div", "class", "sp-trip-body");
			if(divs.size() > 1 ){
				scl.URLflightWF = null;
//				log.info("-----------------------------------------------------------------");
//				log.info(page.asXml());
//				log.info("-----------------------------------------------------------------");
//				HtmlDivision div = page.getFirstByXPath("//div[@class='sp-trip-body']");
				map.put("cf", c1);
				map.put("dd", c2);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);
				

				HtmlDivision qc = page.getFirstByXPath("//div[@class='flightTcity']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='flightTTime']");
				log.info("qc==>"+qc);
				map.put("qc", qc.asText());
				map.put("rq", rq.asText());

				HtmlDivision lk = page.getFirstByXPath("//div[@class='flightTdata']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span.spaceO");
				String adult = lkelments.get(0).text();
				String child = lkelments.get(1).text();
				String baby = lkelments.get(2).text();
				map.put("adult", adult);
				map.put("child", child);
				map.put("baby", baby);

				HtmlDivision div = (HtmlDivision)divs.get(0);
				Document document = Jsoup.parse(div.asXml());
				Elements elements = document.select("div.sp-trip-body ul");
				for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
					Element element = (Element) iterator.next();
					Flight f = new Flight();
					Elements lis = element.select("li");
					Element item0 = lis.get(0);
					if (item0 != null) {
						Element doc = item0;
						// 起飞时间
						f.qf_time = doc.select("div.sp-trip-time").get(0).text().trim();
						// 起飞城市
						f.qf_city = doc.select("div.sp-trip-city").get(0).text().trim();
						// 到达时间
						f.dd_time = doc.select("div.sp-trip-time").get(1).text().trim();
						// 到达城市
						f.dd_city = doc.select("div.sp-trip-city").get(1).text().trim();
						// 航班号
						f.hbh = doc.select("div.sp-trip-stops").get(0).text().trim();
						// 飞机型号
						f.jx = doc.select("div.sp-trip-duration").get(0).text().trim();
					}
					Element item1 = lis.get(1);
					if (item1 != null) {
						Element doc = item1;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f.tdc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f.tdc_href = el.attr("href");
						}
					}

					Element item2 = lis.get(2);
					if (item2 != null) {
						Element doc = item2;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f.gwc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f.gwc_href = el.attr("href");
						}

					}

					Element item3 = lis.get(3);
					if (item3 != null) {
						Element doc = item3;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f.mzjjc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f.mzjjc_href = el.attr("href");
						}

					}
					Element item4 = lis.get(4);
					if (item4 != null) {
						Element doc = item4;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f.jjc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f.jjc_href = el.attr("href");
						}
						if (els.isEmpty()) {
							f.jjc = doc.html();
						}
					}
					flights.add(f);
				}
				map.put("flights", flights);
				

				HtmlDivision div2 = (HtmlDivision) divs.get(1);

				HtmlDivision qc2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTcity").get(1);
				HtmlDivision rq2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTTime").get(1);
				log.info("qc2==>"+qc2);
				map.put("qc2", qc2.asText());
				map.put("rq2", rq2.asText());

				HtmlDivision lk2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTdata").get(1);
				Document lkdoc2 = Jsoup.parse(lk2.asXml());
				Elements lkelments2 = lkdoc2.select("span.spaceO");
				String adult2 = lkelments2.get(0).text();
				String child2 = lkelments2.get(1).text();
				String baby2 = lkelments2.get(2).text();
				map.put("adult2", adult2);
				map.put("child2", child2);
				map.put("baby2", baby2);

				Document document2 = Jsoup.parse(div2.asXml());
				Elements elements2 = document2.select("div.sp-trip-body ul");
				for (Iterator<Element> iterator = elements2.iterator(); iterator.hasNext();) {
					Element element = (Element) iterator.next();
					Flight2 f2 = new Flight2();
					Elements lis = element.select("li");
					Element item0 = lis.get(0);
					if (item0 != null) {
						Element doc = item0;
						// 起飞时间
						f2.qf_time = doc.select("div.sp-trip-time").get(0).text().trim();
						// 起飞城市
						f2.qf_city = doc.select("div.sp-trip-city").get(0).text().trim();
						// 到达时间
						f2.dd_time = doc.select("div.sp-trip-time").get(1).text().trim();
						// 到达城市
						f2.dd_city = doc.select("div.sp-trip-city").get(1).text().trim();
						// 航班号
						f2.hbh = doc.select("div.sp-trip-stops").get(0).text().trim();
						// 飞机型号
						f2.jx = doc.select("div.sp-trip-duration").get(0).text().trim();
					}
					Element item1 = lis.get(1);
					if (item1 != null) {
						Element doc = item1;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f2.tdc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f2.tdc_href = el.attr("href");
						}
					}

					Element item2 = lis.get(2);
					if (item2 != null) {
						Element doc = item2;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f2.gwc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f2.gwc_href = el.attr("href");
						}

					}

					Element item3 = lis.get(3);
					if (item3 != null) {
						Element doc = item3;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f2.mzjjc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f2.mzjjc_href = el.attr("href");
						}

					}
					Element item4 = lis.get(4);
					if (item4 != null) {
						Element doc = item4;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f2.jjc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f2.jjc_href = el.attr("href");
						}
						if (els.isEmpty()) {
							f2.jjc = doc.html();
						}
					}
					flights2.add(f2);
				}
				map.put("flights2", flights2);
//				map.put("t1", t1);
//				map.put("t2", t2);
				break;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					
					e.printStackTrace();
				}
			}
		}
		
		
		for (int j = 0; j <= timeoutmax; j++) {
			HtmlDivision rls = page.getFirstByXPath("//div[@class='flightweek clearfix zh']");
			List<Kalendar> kalendars = new ArrayList<Kalendar>();
			if (rls != null) {
				Document document = Jsoup.parse(rls.asXml());
				Elements elements = document.select("ul li");
				for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
					Element li = (Element) iterator.next();
					Kalendar k = new Kalendar();
					k.id = li.attr("data-date").trim();
//					log.info("cls:" + k.id);
					String cls = li.attr("class");
					if (cls != null && cls.trim().equals("") != true) {
						k.current = cls.trim();
					}
					k.week = li.select("a.weekBtn").get(0).ownText();
					k.date = li.select("span.spaceO").get(0).ownText();
					k.price = li.select("div.weekprice").get(0).ownText();
//					log.info(k);
					kalendars.add(k);
				}
				map.put("kalendars", kalendars);
				
				
				HtmlDivision rls2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightweek clearfix zh").get(1);
				List<Kalendar2> kalendars2 = new ArrayList<Kalendar2>();
				Document document2 = Jsoup.parse(rls2.asXml());
				Elements elements2 = document2.select("ul li");
				for (Iterator<Element> iterator = elements2.iterator(); iterator.hasNext();) {
					Element li = (Element) iterator.next();
					Kalendar2 k2 = new Kalendar2();
					k2.id = li.attr("data-date").trim();
//					log.info("cls:" + k.id);
					String cls2 = li.attr("class");
					if (cls2 != null && cls2.trim().equals("") != true) {
						k2.current = cls2.trim();
					}
					k2.week = li.select("a.weekBtn").get(0).ownText();
					k2.date = li.select("span.spaceO").get(0).ownText();
					k2.price = li.select("div.weekprice").get(0).ownText();
//					log.info(k);
					kalendars2.add(k2);
				}
				map.put("kalendars2", kalendars2);
				break;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
		return map;
	}

	/**
	 * 返程日历2,点击返程日历变更
	 * @param week
	 * @param c1
	 * @param c2
	 * @param year
	 * @param month
	 * @param day
	 * @param mark 
	 * @return
	 */
	public Map<String, Object> flightQueryEx2(String week, String c1, String c2, String year, String month, String day, String year2, String month2, String day2, String mark) {
		log.info("mark=======>"+mark);
		Map<String, Object> map = new HashMap<String, Object>();
		List<Flight> flights = new ArrayList<Flight>();
		List<Flight2> flights2 = new ArrayList<Flight2>();
		HtmlPage page = flightQueryPage.getHtmlPage();
		HtmlDivision flightweekDiv2 =  (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightweek clearfix zh").get(1);
		DomNodeList<HtmlElement> flightweek2lis = flightweekDiv2.getElementsByTagName("li");
		HtmlElement he = null;
		for (int i = 0; i < flightweek2lis.size(); i++) {
			String li_dataName = flightweek2lis.get(i).getAttribute("data-date");
			if(week.equals(li_dataName)) {
				he = flightweek2lis.get(i);
				break;
			}
		}
		clickHandler(he);
		for (int j = 0; j <= timeoutmax; j++) {
			HtmlDivision alert_error = page.getFirstByXPath("//div[@class='alert-info alert-error']");
			HtmlDivision alert_error1 = page.getFirstByXPath("//div[@class='alertinfo-error']");
			if (alert_error != null || alert_error1!= null) {
				map.put("cf", c1);
				map.put("dd", c2);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);
	
				HtmlDivision qc = page.getFirstByXPath("//div[@class='flightTcity']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='flightTTime']");
				
				map.put("qc", qc.asText());// 全程
				map.put("rq", rq.asText());// 日期
	
				HtmlDivision lk = page.getFirstByXPath("//div[@class='flightTdata']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span.spaceO");
				String adult = lkelments.get(0).text();
				String child = lkelments.get(1).text();
				String baby = lkelments.get(2).text();
				map.put("adult", adult);
				map.put("child", child);
				map.put("baby", baby);
				if(alert_error != null){
					map.put("noflight", alert_error.asText());
				}
				if(alert_error1 != null){
					map.put("noflight1", alert_error1.asText());
				}
				return map;
			}
			
			//判断是否有往返程中的单程明细
			if(mark.equals("1")) {
				for (int i = 0; i <= timeoutmax; i++) {
					log.info("第"+(i+1)+"次进入循环");
					List<HtmlElement> selectedFlight = page.getBody().getElementsByAttribute("div", "class", "selectedflight");
					log.info("selectedFlight.size()===>"+selectedFlight.size());
					if(selectedFlight.size() != 0) {
						try {
							Thread.sleep(5000);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						HtmlDivision selectedFlightDiv = (HtmlDivision) selectedFlight.get(0);
						Document doc = Jsoup.parse(selectedFlightDiv.asXml());
						Elements divs = doc.select("div.selectedlist .selectedinfo");
						FlightInfo flightInfo1 = new FlightInfo();
						Element cfcityDiv = divs.get(0);
						Element cfcity = cfcityDiv.select(".selectedcity").get(0);
						flightInfo1.qf_city = cfcity.select("span").get(0).ownText();// 起飞城市
						flightInfo1.qf_time = cfcity.select("span").get(1).ownText();// 起飞时间flight-date
						flightInfo1.qf_date = cfcityDiv.ownText();// 起飞时间
						Element hbhDiv = doc.select("div.selectedlist .selectedcabin").get(0);
						flightInfo1.hbh = hbhDiv.ownText();
						Element ddcityDiv = divs.get(1);
						Element ddcity = ddcityDiv.select(".selectedcity").get(0);
						flightInfo1.dd_city = ddcity.select("span").get(0).ownText();// 到达城市
						flightInfo1.dd_time = ddcity.select("span").get(1).ownText();// 到达时间
						flightInfo1.dd_date = ddcityDiv.ownText();// 到达时间
						Element selectedCon = doc.select(".selectedCon").get(0);
						flightInfo1.cx = selectedCon.select(".selectedtype").get(0).text();
						
						// 概述完成
						FlightInfo flightInfo = new FlightInfo();
						Element selectedcost = doc.select("div.selectedcost").get(0);
						Elements subDivs = selectedcost.select(".selectedcostCon");
						log.info("subDivs.size=====>"+subDivs.size());
						for (int k = 0; k < subDivs.size(); k++) {
							Element subDiv = subDivs.get(k);
							Element subUl = subDiv.select("ul").get(0);
							flightInfo.infos[k].lk = subUl.select("li").get(0).text();
							flightInfo.infos[k].pj = subUl.select("li").get(1).text();
							flightInfo.infos[k].ryf = subUl.select("li").get(2).text();
							flightInfo.infos[k].jcs = subUl.select("li").get(3).text();
							flightInfo.infos[k].bxf = subUl.select("li").get(4).text();
						}
						flightInfo.total = doc.select("div.totalCost").get(0).text();
						map.put("flightInfo1", flightInfo1);
						map.put("flightInfo", flightInfo);
						map.put("mark", "1");
						map.put("display1", "none;");
						map.put("display2", "block;");
						break;
					}
					synchronized (page) {
						try {
							page.wait(200);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						log.info("返回订票信息中。。。。。。。");
					}
				}
			}else {
				map.put("display0", "none;");
				map.put("mark", "2");
			}
			
			List<HtmlElement> divs = page.getBody().getElementsByAttribute("div", "class", "sp-trip-body");
			if(divs.size() > 1){
				scl.URLflightWF = null;
//				log.info("-----------------------------------------------------------------");
//				log.info(page.asXml());
//				log.info("-----------------------------------------------------------------");
//				HtmlDivision div = page.getFirstByXPath("//div[@class='sp-trip-body']");
				map.put("cf", c1);
				map.put("dd", c2);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				HtmlDivision qc = page.getFirstByXPath("//div[@class='flightTcity']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='flightTTime']");
				log.info("qc==>"+qc);
				map.put("qc", qc.asText());
				map.put("rq", rq.asText());

				HtmlDivision lk = page.getFirstByXPath("//div[@class='flightTdata']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span.spaceO");
				String adult = lkelments.get(0).text();
				String child = lkelments.get(1).text();
				String baby = lkelments.get(2).text();
				map.put("adult", adult);
				map.put("child", child);
				map.put("baby", baby);

				HtmlDivision div = (HtmlDivision) divs.get(0);
				Document document = Jsoup.parse(div.asXml());
				Elements elements = document.select("div.sp-trip-body ul");
				for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
					Element element = (Element) iterator.next();
					Flight f = new Flight();
					Elements lis = element.select("li");
					Element item0 = lis.get(0);
					if (item0 != null) {
						Element doc = item0;
						// 起飞时间
						f.qf_time = doc.select("div.sp-trip-time").get(0).text().trim();
						// 起飞城市
						f.qf_city = doc.select("div.sp-trip-city").get(0).text().trim();
						// 到达时间
						f.dd_time = doc.select("div.sp-trip-time").get(1).text().trim();
						// 到达城市
						f.dd_city = doc.select("div.sp-trip-city").get(1).text().trim();
						// 航班号
						f.hbh = doc.select("div.sp-trip-stops").get(0).text().trim();
						// 飞机型号
						f.jx = doc.select("div.sp-trip-duration").get(0).text().trim();
					}
					Element item1 = lis.get(1);
					if (item1 != null) {
						Element doc = item1;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f.tdc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f.tdc_href = el.attr("href");
						}
					}

					Element item2 = lis.get(2);
					if (item2 != null) {
						Element doc = item2;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f.gwc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f.gwc_href = el.attr("href");
						}

					}

					Element item3 = lis.get(3);
					if (item3 != null) {
						Element doc = item3;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f.mzjjc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f.mzjjc_href = el.attr("href");
						}

					}
					Element item4 = lis.get(4);
					if (item4 != null) {
						Element doc = item4;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f.jjc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f.jjc_href = el.attr("href");
						}
						if (els.isEmpty()) {
							f.jjc = doc.html();
						}
					}
					flights.add(f);
				}
				map.put("flights", flights);
				
//				try {
//					Thread.sleep(3000);
//				} catch (InterruptedException e) {
//					e.printStackTrace();
//				}

				HtmlDivision div2 = (HtmlDivision)divs.get(1);

				HtmlDivision qc2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTcity").get(1);
				HtmlDivision rq2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTTime").get(1);
				log.info("qc2==>"+qc2);
				map.put("qc2", qc2.asText());
				map.put("rq2", rq2.asText());

				HtmlDivision lk2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTdata").get(1);
				Document lkdoc2 = Jsoup.parse(lk2.asXml());
				Elements lkelments2 = lkdoc2.select("span.spaceO");
				String adult2 = lkelments2.get(0).text();
				String child2 = lkelments2.get(1).text();
				String baby2 = lkelments2.get(2).text();
				map.put("adult2", adult2);
				map.put("child2", child2);
				map.put("baby2", baby2);

				Document document2 = Jsoup.parse(div2.asXml());
				Elements elements2 = document2.select("div.sp-trip-body ul");
				for (Iterator<Element> iterator = elements2.iterator(); iterator.hasNext();) {
					Element element = (Element) iterator.next();
					Flight2 f2 = new Flight2();
					Elements lis = element.select("li");
					Element item0 = lis.get(0);
					if (item0 != null) {
						Element doc = item0;
						// 起飞时间
						f2.qf_time = doc.select("div.sp-trip-time").get(0).text().trim();
						// 起飞城市
						f2.qf_city = doc.select("div.sp-trip-city").get(0).text().trim();
						// 到达时间
						f2.dd_time = doc.select("div.sp-trip-time").get(1).text().trim();
						// 到达城市
						f2.dd_city = doc.select("div.sp-trip-city").get(1).text().trim();
						// 航班号
						f2.hbh = doc.select("div.sp-trip-stops").get(0).text().trim();
						// 飞机型号
						f2.jx = doc.select("div.sp-trip-duration").get(0).text().trim();
					}
					Element item1 = lis.get(1);
					if (item1 != null) {
						Element doc = item1;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f2.tdc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f2.tdc_href = el.attr("href");
						}
					}

					Element item2 = lis.get(2);
					if (item2 != null) {
						Element doc = item2;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f2.gwc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f2.gwc_href = el.attr("href");
						}

					}

					Element item3 = lis.get(3);
					if (item3 != null) {
						Element doc = item3;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f2.mzjjc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f2.mzjjc_href = el.attr("href");
						}

					}
					Element item4 = lis.get(4);
					if (item4 != null) {
						Element doc = item4;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f2.jjc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f2.jjc_href = el.attr("href");
						}
						if (els.isEmpty()) {
							f2.jjc = doc.html();
						}
					}
					flights2.add(f2);
				}
				map.put("flights2", flights2);
//				map.put("t1", t1);
//				map.put("t2", t2);
				break;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					
					e.printStackTrace();
				}
			}
		}
		
		
		for (int j = 0; j <= timeoutmax; j++) {
			HtmlDivision rls = page.getFirstByXPath("//div[@class='flightweek clearfix zh']");
			List<Kalendar> kalendars = new ArrayList<Kalendar>();
			if (rls != null) {
				Document document = Jsoup.parse(rls.asXml());
				Elements elements = document.select("ul li");
				for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
					Element li = (Element) iterator.next();
					Kalendar k = new Kalendar();
					k.id = li.attr("data-date").trim();
//					log.info("cls:" + k.id);
					String cls = li.attr("class");
					if (cls != null && cls.trim().equals("") != true) {
						k.current = cls.trim();
					}
					k.week = li.select("a.weekBtn").get(0).ownText();
					k.date = li.select("span.spaceO").get(0).ownText();
					k.price = li.select("div.weekprice").get(0).ownText();
//					log.info(k);
					kalendars.add(k);
				}
				map.put("kalendars", kalendars);
				
				HtmlDivision rls2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightweek clearfix zh").get(1);
				List<Kalendar2> kalendars2 = new ArrayList<Kalendar2>();
				Document document2 = Jsoup.parse(rls2.asXml());
				Elements elements2 = document2.select("ul li");
				for (Iterator<Element> iterator = elements2.iterator(); iterator.hasNext();) {
					Element li = (Element) iterator.next();
					Kalendar2 k2 = new Kalendar2();
					k2.id = li.attr("data-date").trim();
//					log.info("cls:" + k.id);
					String cls2 = li.attr("class");
					if (cls2 != null && cls2.trim().equals("") != true) {
						k2.current = cls2.trim();
					}
					k2.week = li.select("a.weekBtn").get(0).ownText();
					k2.date = li.select("span.spaceO").get(0).ownText();
					k2.price = li.select("div.weekprice").get(0).ownText();
//					log.info(k);
					kalendars2.add(k2);
				}
				map.put("kalendars2", kalendars2);
				break;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
		return map;
	}
	
	
	/**
	 * 单程航班查询
	 */
	@Override
	public Map<String, Object> flightQuery(String c1, String c2, String date, int number1, int number2, int number3,
			int year, int month, int day, int year2, int month2, int day2) {
		flightQueryPage = null;
		scl.URLflight = null;
		Map<String, Object> map = new HashMap<String, Object>();
		List<Flight> flights = new ArrayList<Flight>();
		URLflightQuery = Csair.URLflightQuery + "?t=S&c1=" + c1 + "&c2=" + c2 + "&d1=" + date + "&at=" + number1
				+ "&ct=" + number2 + "&it=" + number3;
		log.info("URLflightQuery====>"+URLflightQuery);
//		if (flightQueryPage.isNull() == Boolean.FALSE) {
//			flightQueryPage.setHtmlPage(null);
//		}
		log.info("获取航班查询网址");
		long t1 = System.currentTimeMillis();
		flightQueryPage = webClient.getCsairHtmlPage(URLflightQuery, "URLflightQuery", false);

		HtmlPage page = flightQueryPage.getHtmlPage();
		for (int j = 0; j <= timeoutmax; j++) {
			HtmlDivision confirmDiv = page.getFirstByXPath("//div[@class='confirm-window']");
			if(confirmDiv !=null){
				long t2 = System.currentTimeMillis();
				map.put("errorAlert", "参数错误，请重新查询！");
				map.put("t1", t1);
				map.put("t2", t2);
				return map;
			}
			HtmlDivision alert_error = page.getFirstByXPath("//div[@class='alert-info alert-error']");
			HtmlDivision alert_error1 = page.getFirstByXPath("//div[@class='alertinfo-error']");
			
			if (alert_error != null || alert_error1 != null) {
				long t2 = System.currentTimeMillis();
				map.put("cf", c1);
				map.put("dd", c2);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				HtmlDivision qc = page.getFirstByXPath("//div[@class='flightTcity']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='flightTTime']");
				
				map.put("qc", qc.asText());// 全程
				map.put("rq", rq.asText());// 日期

				HtmlDivision lk = page.getFirstByXPath("//div[@class='flightTdata']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span.spaceO");
				String adult = lkelments.get(0).text();
				String child = lkelments.get(1).text();
				String baby = lkelments.get(2).text();
				map.put("adult", adult);
				map.put("child", child);
				map.put("baby", baby);
				if(alert_error != null){
					map.put("noflight", alert_error.asText());
				}
				if(alert_error1 != null){
					map.put("noflight1", alert_error1.asText());
				}
				
				map.put("t1", t1);
				map.put("t2", t2);
				return map;
			}
		
			if (scl.URLflight != null && page != null) {
//				log.info("-----------------------------------------------------------------");
//				log.info(page.asXml());
//				log.info("-----------------------------------------------------------------");
				long t2 = System.currentTimeMillis();
				HtmlDivision div = page.getFirstByXPath("//div[@class='sp-trip-body']");
				map.put("cf", c1);
				map.put("dd", c2);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				HtmlDivision qc = page.getFirstByXPath("//div[@class='flightTcity']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='flightTTime']");
				log.info("qc==>"+qc);
				map.put("qc", qc.asText());
				map.put("rq", rq.asText());

				HtmlDivision lk = page.getFirstByXPath("//div[@class='flightTdata']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span.spaceO");
				String adult = lkelments.get(0).text();
				String child = lkelments.get(1).text();
				String baby = lkelments.get(2).text();
				map.put("adult", adult);
				map.put("child", child);
				map.put("baby", baby);

				Document document = Jsoup.parse(div.asXml());
				Elements elements = document.select("div.sp-trip-body ul");
				for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
					Element element = (Element) iterator.next();
					Flight f = new Flight();
					Elements lis = element.select("li");
					Element item0 = lis.get(0);
					if (item0 != null) {
						Element doc = item0;
						// 起飞时间
						f.qf_time = doc.select("div.sp-trip-time").get(0).text().trim();
						// 起飞城市
						f.qf_city = doc.select("div.sp-trip-city").get(0).text().trim();
						// 到达时间
						f.dd_time = doc.select("div.sp-trip-time").get(1).text().trim();
						// 到达城市
						f.dd_city = doc.select("div.sp-trip-city").get(1).text().trim();
						// 航班号
						f.hbh = doc.select("div.sp-trip-stops").get(0).text().trim();
						// 飞机型号
						f.jx = doc.select("div.sp-trip-duration").get(0).text().trim();
					}
					Element item1 = lis.get(1);
					if (item1 != null) {
						Element doc = item1;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f.tdc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f.tdc_href = el.attr("href");
						}
					}

					Element item2 = lis.get(2);
					if (item2 != null) {
						Element doc = item2;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f.gwc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f.gwc_href = el.attr("href");
						}

					}

					Element item3 = lis.get(3);
					if (item3 != null) {
						Element doc = item3;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f.mzjjc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f.mzjjc_href = el.attr("href");
						}

					}
					Element item4 = lis.get(4);
					if (item4 != null) {
						Element doc = item4;
						Elements els = doc.select("div.price");
						if (!els.isEmpty()) {
							f.jjc = els.get(0).text().trim();
							Element el = doc.select("li.sp-cabin-cell").get(0);
							f.jjc_href = el.attr("href");
						}
						if (els.isEmpty()) {
							f.jjc = doc.html();
						}
					}
					flights.add(f);
				}
				map.put("flights", flights);
				map.put("t1", t1);
				map.put("t2", t2);
				scl.URLflight = null;
				scl.URLflightWF = null;
				
				break;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
		for (int j = 0; j <= timeoutmax; j++) {
			HtmlDivision rls = page.getFirstByXPath("//div[@class='flightweek clearfix zh']");
			List<Kalendar> kalendars = new ArrayList<Kalendar>();
			if (rls != null) {
				Document document = Jsoup.parse(rls.asXml());
				Elements elements = document.select("ul li");
				for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
					Element li = (Element) iterator.next();
					Kalendar k = new Kalendar();
					k.id = li.attr("data-date").trim();
//					log.info("cls:" + k.id);
					String cls = li.attr("class");
					if (cls != null && cls.trim().equals("") != true) {
						k.current = cls.trim();
					}
					k.week = li.select("a.weekBtn").get(0).ownText();
					k.date = li.select("span.spaceO").get(0).ownText();
					k.price = li.select("div.weekprice").get(0).ownText();
//					log.info(k);
					kalendars.add(k);
				}
				map.put("kalendars", kalendars);
				break;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
		return map;
	}

	/**
	 * 往返航班查询
	 */
	@Override
	public Map<String, Object> flightQuery2(String c1, String c2, String date, String date2, int number1, int number2,
			int number3, int year, int month, int day, int year2, int month2, int day2) {

		Map<String, Object> map = new HashMap<String, Object>();
		List<Flight> flights = new ArrayList<Flight>();
		List<Flight2> flights2 = new ArrayList<Flight2>();
		URLflightQuery = Csair.URLflightQuery + "?t=R&c1=" + c1 + "&c2=" + c2 + "&d1=" + date +"&d2="+ date2 +"&at=" + number1
				+ "&ct=" + number2 + "&it=" + number3;
		log.info("URLflightQuery====>"+URLflightQuery);
		if (flightQueryPage.isNull() == Boolean.FALSE) {
			flightQueryPage.setHtmlPage(null);
		}
		log.info("获取航班查询网址");
		long t1 = System.currentTimeMillis();
		flightQueryPage = webClient.getCsairHtmlPage(URLflightQuery, "URLflightQuery", false);

		HtmlPage page = flightQueryPage.getHtmlPage();
		for (int j = 0; j <= 2*timeoutmax; j++) {
			HtmlDivision confirmDiv = page.getFirstByXPath("//div[@class='confirm-window']");
			if(confirmDiv !=null){
				long t2 = System.currentTimeMillis();
				map.put("errorAlert", "参数错误，请重新查询！");
				map.put("t1", t1);
				map.put("t2", t2);
				return map;
			}
			HtmlDivision alert_error = page.getFirstByXPath("//div[@class='alert-info alert-error']");
			HtmlDivision alert_error1 = page.getFirstByXPath("//div[@class='alertinfo-error']");
			
			if (alert_error != null || alert_error1 != null) {
				long t2 = System.currentTimeMillis();
				map.put("cf", c1);
				map.put("dd", c2);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				HtmlDivision qc = page.getFirstByXPath("//div[@class='flightTcity']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='flightTTime']");
				
				map.put("qc", qc.asText());// 全程
				map.put("rq", rq.asText());// 日期

				HtmlDivision lk = page.getFirstByXPath("//div[@class='flightTdata']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span.spaceO");
				String adult = lkelments.get(0).text();
				String child = lkelments.get(1).text();
				String baby = lkelments.get(2).text();
				map.put("adult", adult);
				map.put("child", child);
				map.put("baby", baby);
				if(alert_error != null){
					map.put("noflight", alert_error.asText());
				}
				if(alert_error1 != null){
					map.put("noflight1", alert_error1.asText());
				}
				
				map.put("t1", t1);
				map.put("t2", t2);
				return map;
			}
			List<HtmlElement> divs = page.getBody().getElementsByAttribute("div", "class", "sp-trip-body");
			int divSize = divs.size();
			log.info("divSize====>"+divSize);
			if (page != null && divSize == 2) {
				HtmlDivision div = page.getFirstByXPath("//div[@class='sp-trip-body']");
				
				if(div != null ){
					
//					log.info("-----------------------------------------------------------------");
//					log.info(page.asXml());
//					log.info("-----------------------------------------------------------------");
					long t2 = System.currentTimeMillis();
	//				HtmlDivision div = page.getFirstByXPath("//div[@class='sp-trip-body']");
					map.put("cf", c1);
					map.put("dd", c2);
					map.put("year", year);
					map.put("month", month);
					map.put("day", day);
					map.put("year2", year2);
					map.put("month2", month2);
					map.put("day2", day2);
					map.put("mark", "2");
					map.put("display0", "none;");
					map.put("display1", "block;");
					map.put("display2", "block;");
	
					HtmlDivision qc = page.getFirstByXPath("//div[@class='flightTcity']");
					HtmlDivision rq = page.getFirstByXPath("//div[@class='flightTTime']");
					log.info("qc==>"+qc.asText());
					log.info("rq==>"+rq.asText());
					log.info("--------------------");
					map.put("qc", qc.asText());
					map.put("rq", rq.asText());
	
					HtmlDivision lk = page.getFirstByXPath("//div[@class='flightTdata']");
					Document lkdoc = Jsoup.parse(lk.asXml());
					Elements lkelments = lkdoc.select("span.spaceO");
					String adult = lkelments.get(0).text();
					String child = lkelments.get(1).text();
					String baby = lkelments.get(2).text();
					map.put("adult", adult);
					map.put("child", child);
					map.put("baby", baby);
	
					Document document = Jsoup.parse(div.asXml());
					Elements elements = document.select("div.sp-trip-body ul");
					for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
						Element element = (Element) iterator.next();
						Flight f = new Flight();
						Elements lis = element.select("li");
						Element item0 = lis.get(0);
						if (item0 != null) {
							Element doc = item0;
							// 起飞时间
							f.qf_time = doc.select("div.sp-trip-time").get(0).text().trim();
							// 起飞城市
							f.qf_city = doc.select("div.sp-trip-city").get(0).text().trim();
							// 到达时间
							f.dd_time = doc.select("div.sp-trip-time").get(1).text().trim();
							// 到达城市
							f.dd_city = doc.select("div.sp-trip-city").get(1).text().trim();
							// 航班号
							f.hbh = doc.select("div.sp-trip-stops").get(0).text().trim();
							// 飞机型号
							f.jx = doc.select("div.sp-trip-duration").get(0).text().trim();
						}
						Element item1 = lis.get(1);
						if (item1 != null) {
							Element doc = item1;
							Elements els = doc.select("div.price");
							if (!els.isEmpty()) {
								f.tdc = els.get(0).text().trim();
								Element el = doc.select("li.sp-cabin-cell").get(0);
								f.tdc_href = el.attr("href");
							}
						}
	
						Element item2 = lis.get(2);
						if (item2 != null) {
							Element doc = item2;
							Elements els = doc.select("div.price");
							if (!els.isEmpty()) {
								f.gwc = els.get(0).text().trim();
								Element el = doc.select("li.sp-cabin-cell").get(0);
								f.gwc_href = el.attr("href");
							}
	
						}
	
						Element item3 = lis.get(3);
						if (item3 != null) {
							Element doc = item3;
							Elements els = doc.select("div.price");
							if (!els.isEmpty()) {
								f.mzjjc = els.get(0).text().trim();
								Element el = doc.select("li.sp-cabin-cell").get(0);
								f.mzjjc_href = el.attr("href");
							}
	
						}
						Element item4 = lis.get(4);
						if (item4 != null) {
							Element doc = item4;
							Elements els = doc.select("div.price");
							if (!els.isEmpty()) {
								f.jjc = els.get(0).text().trim();
								Element el = doc.select("li.sp-cabin-cell").get(0);
								f.jjc_href = el.attr("href");
							}
							if (els.isEmpty()) {
								f.jjc = doc.html();
							}
						}
						flights.add(f);
					}
					map.put("flights", flights);
					map.put("t1", t1);
					map.put("t2", t2);
					
//					try {
//						Thread.sleep(3000);
//					} catch (InterruptedException e) {
//						e.printStackTrace();
//					}
	
					HtmlDivision div2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "sp-trip-body").get(1);
	
					HtmlDivision qc2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTcity").get(1);
					HtmlDivision rq2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTTime").get(1);
					log.info("qc2==>"+qc2.asText());
					log.info("rq2==>"+rq2.asText());
					map.put("qc2", qc2.asText());
					map.put("rq2", rq2.asText());
	
					HtmlDivision lk2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTdata").get(1);
					Document lkdoc2 = Jsoup.parse(lk2.asXml());
					Elements lkelments2 = lkdoc2.select("span.spaceO");
					String adult2 = lkelments2.get(0).text();
					String child2 = lkelments2.get(1).text();
					String baby2 = lkelments2.get(2).text();
					map.put("adult2", adult2);
					map.put("child2", child2);
					map.put("baby2", baby2);
	
					Document document2 = Jsoup.parse(div2.asXml());
					Elements elements2 = document2.select("div.sp-trip-body ul");
					for (Iterator<Element> iterator = elements2.iterator(); iterator.hasNext();) {
						Element element = (Element) iterator.next();
						Flight2 f2 = new Flight2();
						Elements lis = element.select("li");
						Element item0 = lis.get(0);
						if (item0 != null) {
							Element doc = item0;
							// 起飞时间
							f2.qf_time = doc.select("div.sp-trip-time").get(0).text().trim();
							// 起飞城市
							f2.qf_city = doc.select("div.sp-trip-city").get(0).text().trim();
							// 到达时间
							f2.dd_time = doc.select("div.sp-trip-time").get(1).text().trim();
							// 到达城市
							f2.dd_city = doc.select("div.sp-trip-city").get(1).text().trim();
							// 航班号
							f2.hbh = doc.select("div.sp-trip-stops").get(0).text().trim();
							// 飞机型号
							f2.jx = doc.select("div.sp-trip-duration").get(0).text().trim();
						}
						Element item1 = lis.get(1);
						if (item1 != null) {
							Element doc = item1;
							Elements els = doc.select("div.price");
							if (!els.isEmpty()) {
								f2.tdc = els.get(0).text().trim();
								Element el = doc.select("li.sp-cabin-cell").get(0);
								f2.tdc_href = el.attr("href");
							}
						}
	
						Element item2 = lis.get(2);
						if (item2 != null) {
							Element doc = item2;
							Elements els = doc.select("div.price");
							if (!els.isEmpty()) {
								f2.gwc = els.get(0).text().trim();
								Element el = doc.select("li.sp-cabin-cell").get(0);
								f2.gwc_href = el.attr("href");
							}
						}
	
						Element item3 = lis.get(3);
						if (item3 != null) {
							Element doc = item3;
							Elements els = doc.select("div.price");
							if (!els.isEmpty()) {
								f2.mzjjc = els.get(0).text().trim();
								Element el = doc.select("li.sp-cabin-cell").get(0);
								f2.mzjjc_href = el.attr("href");
							}
						}
						Element item4 = lis.get(4);
						if (item4 != null) {
							Element doc = item4;
							Elements els = doc.select("div.price");
							if (!els.isEmpty()) {
								f2.jjc = els.get(0).text().trim();
								Element el = doc.select("li.sp-cabin-cell").get(0);
								f2.jjc_href = el.attr("href");
							}
							if (els.isEmpty()) {
								f2.jjc = doc.html();
							}
						}
						flights2.add(f2);
					}
					map.put("flights2", flights2);
	//				map.put("t1", t1);
	//				map.put("t2", t2);
					scl.URLflight = null;
					scl.URLflightWF = null;
				}
				break;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
		
		for (int j = 0; j <= timeoutmax; j++) {
			HtmlDivision rls = page.getFirstByXPath("//div[@class='flightweek clearfix zh']");
			List<Kalendar> kalendars = new ArrayList<Kalendar>();
			if (rls != null) {
				Document document = Jsoup.parse(rls.asXml());
				Elements elements = document.select("ul li");
				for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
					Element li = (Element) iterator.next();
					Kalendar k = new Kalendar();
					k.id = li.attr("data-date").trim();
//					log.info("cls:" + k.id);
					String cls = li.attr("class");
					if (cls != null && cls.trim().equals("") != true) {
						k.current = cls.trim();
					}
					k.week = li.select("a.weekBtn").get(0).ownText();
					k.date = li.select("span.spaceO").get(0).ownText();
					k.price = li.select("div.weekprice").get(0).ownText();
//					log.info(k);
					kalendars.add(k);
				}
				map.put("kalendars", kalendars);
				
				
				HtmlDivision rls2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightweek clearfix zh").get(1);
				List<Kalendar2> kalendars2 = new ArrayList<Kalendar2>();
				Document document2 = Jsoup.parse(rls2.asXml());
				Elements elements2 = document2.select("ul li");
				for (Iterator<Element> iterator = elements2.iterator(); iterator.hasNext();) {
					Element li = (Element) iterator.next();
					Kalendar2 k2 = new Kalendar2();
					k2.id = li.attr("data-date").trim();
//					log.info("cls:" + k.id);
					String cls2 = li.attr("class");
					if (cls2 != null && cls2.trim().equals("") != true) {
						k2.current = cls2.trim();
					}
					k2.week = li.select("a.weekBtn").get(0).ownText();
					k2.date = li.select("span.spaceO").get(0).ownText();
					k2.price = li.select("div.weekprice").get(0).ownText();
//					log.info(k);
					kalendars2.add(k2);
				}
				map.put("kalendars2", kalendars2);
				break;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
		
		return map;
	
	}
	/**
	 * 航班票价选择
	 */

	public List<Reserve> flightSelection1(String href) {
		log.info("方法中的href---->" + href);
		List<Reserve> list = new ArrayList<Reserve>();
		HtmlPage page = flightQueryPage.getHtmlPage();
		HtmlElement li = page.getBody().getElementsByAttribute("li", "href", href).get(0);
		clickHandler(li);
		
		String listLi = li.getParentNode().getLastChild().asXml();
		Document lis = Jsoup.parse(listLi);
		Elements divList = lis.select("div.cabin-detail-list");
		int count = 0 ;
		for (Iterator<Element> iterator = divList.iterator(); iterator.hasNext();) {
			Element div = (Element) iterator.next();
			Reserve reserve = new Reserve();
			String deName = div.select("div.ca-de-name").text();
			reserve.name = deName;
			reserve.count = count;
			
			Elements kpxx = div.select("div.ca-label-float");
			if(kpxx.size()==4){
				reserve.cw = kpxx.get(0).text();
				reserve.zk = kpxx.get(1).text();
				reserve.tg = kpxx.get(2).text();
				reserve.lc = kpxx.get(3).text();
			}
			if(kpxx.size()==3){
				reserve.cw = kpxx.get(0).text();
				reserve.zk = kpxx.get(1).text();
				reserve.tg = kpxx.get(2).text();
			}
			if(kpxx.size()==2){
				reserve.cw = kpxx.get(0).text();
				reserve.tg = kpxx.get(1).text();
			}
			reserve.xl = div.select("div.ca-label-bagg").get(0).text();
			log.info("舱位:"+reserve.cw+" 折扣:"+reserve.zk+" 退改:"+reserve.tg+" 里程:"+reserve.lc+" 行李:"+reserve.xl);
			
			String price = div.select("div.ca-de-price").text();
			reserve.price = price;
//			String leftNum = div.select("span.leftNum ").text();
//			reserve.remainder = leftNum;
			String href1 = div.getElementsByAttributeValue("otitle", "预订流程-航班选择-预订").get(0).attr("href");
			reserve.href = href1;
			log.info(href1);
			list.add(reserve);
//			log.info(reserve);
			count++;
		}
		return list;
	}

	/**
	 * 航班票价选择
	 */
//	@Override
//	public String flightSelection(String href) {
//		log.info("方法中的href---->" + href);
//		HtmlPage page = flightQueryPage.getHtmlPage();
//		HtmlElement li = page.getBody().getElementsByAttribute("li", "href", href).get(0);
//		clickHandler(li);
//		String listLi = li.getParentNode().getLastChild().asXml();
//		Document lis = Jsoup.parse(listLi);
//
//		Elements divList = lis.select("div.cabin-detail-list");
//		for (Iterator<Element> iterator = divList.iterator(); iterator.hasNext();) {
//			Element div = (Element) iterator.next();
//			Reserve reserve = new Reserve();
//
//			String deName = div.select("div.ca-de-name").text();
//			reserve.name = deName;
//			Elements kpxx = div.select("div.ca-label-float");
//			reserve.cw = kpxx.get(0).text();
//			reserve.zk = kpxx.get(1).text();
//			reserve.tg = "<a href='##' id='tg'>"+kpxx.get(2).text()+"</a>";
//			reserve.lc = kpxx.get(3).text();
//			reserve.xl = div.select("div.ca-label-bagg").get(0).text();
//			log.info("舱位:"+reserve.cw+" 折扣:"+reserve.zk+" 退改:"+reserve.tg+" 里程:"+reserve.lc+" 行李:"+reserve.xl);
//			
//			String price = div.select("div.ca-de-price").text();
//			reserve.price = price;
//			div.select("a").attr("title", deName + " " + price + "  预  订");
//		}
//		return lis.toString();
//	}

	/**
	 * 显示退改信息获取焦点
	 * @param tgnum
	 */
	@Override
	public Map<String, Object> tgxx(String tgnum) {
		Map<String, Object> map = new HashMap<String, Object>();
		ArrayList<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
		HtmlPage page = flightQueryPage.getHtmlPage();
		HtmlElement a = page.getBody().getElementsByAttribute("a", "data-tip-class", "ticket-show").get(Integer.parseInt(tgnum));
		a.mouseOver();
//		HtmlDivision contentDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div","class", "tooltip-content").get(0);
//		log.info("contentDiv===>"+contentDiv.asXml());
//		log.info("------------------------------------------------------------------");
//		log.info("page====>"+page.asXml());
		CS cs = loadPageHandler(flightQueryPage, "//div[@class='ticket-box']");
		if(CS.SUCCESS == cs){
			HtmlDivision tgxx = (HtmlDivision) page.getBody().getElementsByAttribute("div","class", "ticket-box").get(0);
			Document tgxxDoc = Jsoup.parse(tgxx.asXml());
			Elements tables = tgxxDoc.select("table");
			for (int i = 0; i < tables.size(); i++) {
				Map<String, Object> map1 = new HashMap<String, Object>();
				Elements h4 = tgxxDoc.select("h4");
				if(h4.size() != 0){
					 String xc = h4.get(i).text();
					 map1.put("xc",xc );
				}
				Elements trs = tables.get(i).select("tr");
				Element tr1 = trs.get(1);
				Elements thBefore = tr1.select("td.odd");
				String fbefore = thBefore.get(0).text();
				String thBeforeChange = thBefore.get(1).text().replace("?", "￥");
				String thBeforeRefund = thBefore.get(2).text().replace("?", "￥");
				String endorsement1 = thBefore.get(3).text();
				
				Element tr2 = trs.get(2);
				Elements thAfter = tr2.select("td.even");
				String fAfter = thAfter.get(0).text();
				String thAfterChange = thAfter.get(1).text().replace("?", "￥");
				String thAfterRefund = thAfter.get(2).text().replace("?", "￥");
				String endorsement2 = thAfter.get(3).text();
				
				map1.put("fbefore",fbefore );
				map1.put("thBeforeChange",thBeforeChange );
				map1.put("thBeforeRefund",thBeforeRefund );
				map1.put("endorsement1",endorsement1 );
				map1.put("fAfter",fAfter );
				map1.put("thAfterChange",thAfterChange );
				map1.put("thAfterRefund",thAfterRefund );
				map1.put("endorsement2",endorsement2 );
				list.add(map1);
			}
			map.put("list", list);
		}
		return map;
	}
	
	/**
	 * 行李信息获得焦点
	 * @param xlnum
	 * @return
	 */
	@Override
	public Map<String, Object> xlxx(String xlnum) {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = flightQueryPage.getHtmlPage();
		HtmlElement a = page.getBody().getElementsByAttribute("a", "data-tip-class", "baggage-show").get(Integer.parseInt(xlnum));
		a.mouseOver();
		CS cs = loadPageHandler(flightQueryPage, "//div[@class='baggage']");
		if(CS.SUCCESS == cs){
			HtmlDivision xlxx = (HtmlDivision) page.getBody().getElementsByAttribute("div","class", "baggage").get(0);
			map.put("xlxx", xlxx.asText());
		}
		return map;
	}

	
	
	/**
	 * 退改信息失去焦点
	 * @param tgnum
	 * @return
	 */
	@Override
	public Map<String, Object> tgxxOut(String tgnum) {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = flightQueryPage.getHtmlPage();
		HtmlElement a = page.getBody().getElementsByAttribute("a", "data-tip-class", "ticket-show").get(Integer.parseInt(tgnum));
		a.mouseOut();
		map.put("notice", "success");
		return map;
	}
	
	/**
	 * 行李信息失去焦点
	 * @param xlnum
	 * @return
	 */
	@Override
	public Map<String, Object> xlxxOut(String xlnum) {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = flightQueryPage.getHtmlPage();
		HtmlElement a = page.getBody().getElementsByAttribute("a", "data-tip-class", "baggage-show").get(Integer.parseInt(xlnum));
		a.mouseOut();
		map.put("notice", "success");
		return map;
	}

	
	/**
	 * 点击订票
	 */
	@Override
	public Boolean getBuyButton(String href) {
		scl.URLPassengerInformation = null;
		HtmlPage page = flightQueryPage.getHtmlPage();
		List<HtmlElement> selectedtypes = page.getBody().getElementsByAttribute("div", "class", "selectedtype");
		HtmlListItem liChecked;
		if(selectedtypes.size() != 0) {
			HtmlDivision selectedtype = (HtmlDivision) selectedtypes.get(0);
			String selectedtypeText = selectedtype.asText();
			if(selectedtypeText.equals("去程")) {
				liChecked = (HtmlListItem) page.getBody().getElementsByAttribute("li", "class", "sp-cabin-cell cabin-0 checked").get(1);
			}else {
				liChecked = (HtmlListItem) page.getBody().getElementsByAttribute("li", "class", "sp-cabin-cell cabin-0 checked").get(0);
			}
		}else {
			liChecked = (HtmlListItem) page.getBody().getElementsByAttribute("li", "class", "sp-cabin-cell cabin-0 checked").get(0);
		}
		
		log.info(liChecked.asXml());
		HtmlUnorderedList ul = (HtmlUnorderedList) liChecked.getParentNode();
		HtmlListItem li = (HtmlListItem) ul.getLastChild();
		href = "#" + href;
		HtmlElement buyButton = li.getElementsByAttribute("a", "href", href).get(0);
		page = clickHandler(buyButton);
		log.info("页面点击订票");
		for (int i = 0; i <= timeoutmax; i++) {
			try {
				Thread.sleep(500);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			log.info("等待返回旅客信息页面url......");
			if (scl.URLPassengerInformation != null) {
				log.info("旅客信息页面url=====>" + scl.URLPassengerInformation);
				return Boolean.TRUE;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("等待返回url.....");
			}
		}
		return Boolean.FALSE;
	}

	
	/**
	 * 往返航班第一次选择订票
	 */
	@Override
	public Map<String, Object> buyButtonFirst(String href) {
		Map<String, Object> map = new HashMap<String,Object>();
		HtmlPage page = flightQueryPage.getHtmlPage();
		HtmlListItem liChecked = (HtmlListItem) page.getBody().getElementsByAttribute("li", "class", "sp-cabin-cell cabin-0 checked").get(0);
		HtmlUnorderedList ul = (HtmlUnorderedList) liChecked.getParentNode();
		HtmlListItem li = (HtmlListItem) ul.getLastChild();
		href = "#" + href;
		HtmlElement buyButton = li.getElementsByAttribute("a", "href", href).get(0);
//		HtmlElement buyButton = page.getBody().getElementsByAttribute("a", "href", href).get(0);
		page = clickHandler(buyButton);
		log.info("往返第一次点击订票");
		for (int i = 0; i <= timeoutmax; i++) {
			log.info("第"+(i+1)+"次进入循环");
			HtmlDivision alert_msg_box = (HtmlDivision) page.getElementById("alert_msg_box");
			if(alert_msg_box != null) {
				String style = alert_msg_box.getAttribute("style");
				if(!style.contains("none")) {
					HtmlDivision confirm_window = (HtmlDivision) alert_msg_box.getElementsByAttribute("div", "class", "confirm-window").get(0);
					String errorinfo = confirm_window.getElementsByTagName("p").get(0).asText();
					map.put("msg", errorinfo);
					map.put("notice", "false");
					return map;
				}
			}
			List<HtmlElement> selectedFlight = page.getBody().getElementsByAttribute("div", "class", "selectedflight");
			log.info("selectedFlight.size()===>"+selectedFlight.size());
			if(selectedFlight.size() != 0) {
				try {
					Thread.sleep(5000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				HtmlDivision selectedFlightDiv = (HtmlDivision) selectedFlight.get(0);
				Document doc = Jsoup.parse(selectedFlightDiv.asXml());
				Elements divs = doc.select("div.selectedlist .selectedinfo");
				FlightInfo flightInfo1 = new FlightInfo();
				Element cfcityDiv = divs.get(0);
				Element cfcity = cfcityDiv.select(".selectedcity").get(0);
				flightInfo1.qf_city = cfcity.select("span").get(0).ownText();// 起飞城市
				flightInfo1.qf_time = cfcity.select("span").get(1).ownText();// 起飞时间flight-date
				flightInfo1.qf_date = cfcityDiv.ownText();// 起飞时间
				Element hbhDiv = doc.select("div.selectedlist .selectedcabin").get(0);
				flightInfo1.hbh = hbhDiv.ownText();
				Element ddcityDiv = divs.get(1);
				Element ddcity = ddcityDiv.select(".selectedcity").get(0);
				flightInfo1.dd_city = ddcity.select("span").get(0).ownText();// 到达城市
				flightInfo1.dd_time = ddcity.select("span").get(1).ownText();// 到达时间
				flightInfo1.dd_date = ddcityDiv.ownText();// 到达时间
				Element selectedCon = doc.select(".selectedCon").get(0);
				flightInfo1.cx = selectedCon.select(".selectedtype").get(0).text();
				
				// 概述完成
				FlightInfo flightInfo = new FlightInfo();
				Element selectedcost = doc.select("div.selectedcost").get(0);
				Elements subDivs = selectedcost.select(".selectedcostCon");
				log.info("subDivs.size=====>"+subDivs.size());
				for (int k = 0; k < subDivs.size(); k++) {
					Element subDiv = subDivs.get(k);
					Element subUl = subDiv.select("ul").get(0);
					flightInfo.infos[k].lk = subUl.select("li").get(0).text();
					flightInfo.infos[k].pj = subUl.select("li").get(1).text();
					flightInfo.infos[k].ryf = subUl.select("li").get(2).text();
					flightInfo.infos[k].jcs = subUl.select("li").get(3).text();
					flightInfo.infos[k].bxf = subUl.select("li").get(4).text();
				}
				flightInfo.total = doc.select("div.totalCost").get(0).text();
				map.put("flightInfo1", flightInfo1);
				map.put("flightInfo", flightInfo);
				map.put("notice", "true");
				return map;
			}
			synchronized (page) {
				try {
					page.wait(200);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("返回订票信息中。。。。。。。");
			}
		}
		map.put("notice", "false");
		map.put("msg", "加载超时！");
		return  map;
	}
	
	/**
	 * 不登录直接购票
	 */
	@Override
	public Map<String, Object> nologinorder(String href) {
		scl.URLPassengerInformation = null;
		Map<String, Object> map = new HashMap<String,Object>();
		HtmlPage page = flightQueryPage.getHtmlPage();
		HtmlElement buyButton = null;
		HtmlDivision box = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "single-flight-box").get(0);
		String boxStyle = box.getAttribute("style");
		if(boxStyle.contains("none")) {
			HtmlListItem liChecked = (HtmlListItem) page.getBody().getElementsByAttribute("li", "class", "sp-cabin-cell cabin-0 checked").get(1);
			HtmlUnorderedList ul = (HtmlUnorderedList) liChecked.getParentNode();
			HtmlListItem li = (HtmlListItem) ul.getLastChild();
			href = "#" + href;
			buyButton = li.getElementsByAttribute("a", "href", href).get(0);
		}else {
			HtmlListItem liChecked = (HtmlListItem) page.getBody().getElementsByAttribute("li", "class", "sp-cabin-cell cabin-0 checked").get(0);
			HtmlUnorderedList ul = (HtmlUnorderedList) liChecked.getParentNode();
			HtmlListItem li = (HtmlListItem) ul.getLastChild();
			href = "#" + href;
			buyButton = li.getElementsByAttribute("a", "href", href).get(0);
		}
		
	//	HtmlElement buyButton = page.getBody().getElementsByAttribute("a", "href", href).get(0);
		log.info(buyButton.asXml());
		clickHandler(buyButton);
		try {
			Thread.sleep(500);
		} catch (InterruptedException e2) {
			e2.printStackTrace();
		}
		HtmlDivision alert_msg_box = (HtmlDivision) page.getElementById("alert_msg_box");
		if(alert_msg_box != null) {
			String style = alert_msg_box.getAttribute("style");
			if(!style.contains("none")) {
				HtmlDivision confirm_window = (HtmlDivision) alert_msg_box.getElementsByAttribute("div", "class", "confirm-window").get(0);
				String errorinfo = confirm_window.getElementsByTagName("p").get(0).asText();
				map.put("content", errorinfo);
				map.put("notice", "false");
				return map;
			}
		}else {
			HtmlElement noLoginOrder = (HtmlElement) page.getElementById("noLogin_btn");
			clickHandler(noLoginOrder);
			for (int i = 0; i <= timeoutmax; i++) {
				try {
					Thread.sleep(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("等待返回旅客信息页面url......");
				if (scl.URLPassengerInformation != null) {
					log.info("旅客信息页面url=====>" + scl.URLPassengerInformation);
					map.put("notice", "true");
					return map;
				}
				synchronized (page) {
					try {
						page.wait(500);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
					log.info("等待返回url.....");
				}
			}
		}
		
		map.put("notice", "false");
		map.put("content", "旅客信息页面获取失败！");
		return map;
	}

	/**
	 * 非登录用户登录订票
	 * 
	 * @param username
	 * @param password
	 */
	@Override
	public CsairReturnValue tologin(String href, String username, String password) {
		scl.URLPassengerInformation = null;
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = flightQueryPage.getHtmlPage();
		List<HtmlElement> single_flight_boxDivs = page.getBody().getElementsByAttribute("div", "class", "single-flight-box");
		HtmlListItem liChecked;
		for (int i = 0; i < single_flight_boxDivs.size(); i++) {
			HtmlDivision single_flight_boxDiv = (HtmlDivision) single_flight_boxDivs.get(i);
			String single_flight_boxDivStyle = single_flight_boxDiv.getAttribute("style");
			if(single_flight_boxDivStyle.trim().length() == 0) {
				liChecked = (HtmlListItem) single_flight_boxDiv.getElementsByAttribute("li", "class", "sp-cabin-cell cabin-0 checked").get(0);
				HtmlUnorderedList ul = (HtmlUnorderedList) liChecked.getParentNode();
				HtmlListItem li = (HtmlListItem) ul.getLastChild();
				href = "#" + href;
				HtmlElement buyButton = li.getElementsByAttribute("a", "href", href).get(0);
				clickHandler(buyButton);
				try {
					Thread.sleep(500);
				} catch (InterruptedException e2) {
					e2.printStackTrace();
				}
				HtmlDivision alert_msg_box = (HtmlDivision) page.getElementById("alert_msg_box");
				if(alert_msg_box != null) {
					String style = alert_msg_box.getAttribute("style");
					if(!style.contains("none")) {
						HtmlDivision confirm_window = (HtmlDivision) alert_msg_box.getElementsByAttribute("div", "class", "confirm-window").get(0);
						String errorinfo = confirm_window.getElementsByTagName("p").get(0).asText();
						returnValue.setMessage(errorinfo);
						return returnValue;
					}
				}
				break;
			}
		}
//		HtmlListItem liChecked = (HtmlListItem) page.getBody().getElementsByAttribute("li", "class", "sp-cabin-cell cabin-0 checked").get(0);
//		log.info(liChecked.asXml());
//		HtmlUnorderedList ul = (HtmlUnorderedList) liChecked.getParentNode();
//		HtmlListItem li = (HtmlListItem) ul.getLastChild();
//		href = "#" + href;
//		log.info("href===>"+href);
//		HtmlElement buyButton = li.getElementsByAttribute("a", "href", href).get(0);
//		clickHandler(buyButton);
		HtmlForm form = page.getFirstByXPath("//form[@id='memberLogin']");
		page.setFocusedElement(form);
		flightQueryPage.setParent(form);
		HtmlInput usernameInput = form.getFirstByXPath("//input[@id='userId']");
		usernameInput.setValueAttribute(username);
		HtmlInput passwordInput = form.getFirstByXPath("//input[@id='passWordPH']");
		page.setFocusedElement(passwordInput);
		HtmlInput realPasswordInput = form.getFirstByXPath("//input[@id='passWord']");
		realPasswordInput.setValueAttribute(password);
		HtmlInput loginProtocol = form.getFirstByXPath("//input[@id='loginProtocol']");
		clickHandler(loginProtocol);
		
		HtmlButton loginButton = form.getFirstByXPath("//button[@id='mem_btn_login']");
		page = clickHandler(loginButton);
		try {
			Thread.sleep(2000);
		} catch (InterruptedException e2) {
			e2.printStackTrace();
		}
		HtmlDivision erro = form.getFirstByXPath("//div[@class='lg-msg error']");
		if (erro != null) {
			returnValue.setMessage(erro.asText());
			return returnValue;
		}
		for (int i = 0; i <= timeoutmax; i++) {
			if (scl.URLPassengerInformation != null) {
				log.info("登录成功!准备进入旅客信息页");
				returnValue = checkLoginReturnValue(returnValue);
				break;
			}
			synchronized (page) {
				try {
					page.wait(200);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
			log.info("登录中.....");
		}
		returnValue.setMessage("登录失败，请仔细核对帐号和密码");
		return returnValue;
	}

	/**
	 * 非登录用户动态密码登录发送验证码
	 */
	@Override
	public CsairReturnValue tologinYzm(String href, String username) {
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = flightQueryPage.getHtmlPage();
		HtmlListItem liChecked = (HtmlListItem) page.getBody().getElementsByAttribute("li", "class", "sp-cabin-cell cabin-0 checked").get(0);
		log.info(liChecked.asXml());
		HtmlUnorderedList ul = (HtmlUnorderedList) liChecked.getParentNode();
		HtmlListItem li = (HtmlListItem) ul.getLastChild();
		href = "#" + href;
		HtmlElement buyButton = li.getElementsByAttribute("a", "href", href).get(0);
		clickHandler(buyButton);
		HtmlElement hp = (HtmlElement) page.getFirstByXPath("//li[@class='left psw-login']");
		clickHandler(hp);
		HtmlDivision div = (HtmlDivision) page.getFirstByXPath("//div[@id='dynamicPswBox']");
		HtmlForm form = (HtmlForm) div.getFirstByXPath("//form[@id='dynamicPswLogin']");
		HtmlInput mobile = (HtmlInput) form.getFirstByXPath("//input[@id='mobile']");
		page.setFocusedElement(mobile);
		mobile.setValueAttribute(username);
		mobile.type(13);// 回车
		HtmlDivision yzm = (HtmlDivision) form.getFirstByXPath("//div[@id='dyn_btn_psw']");
		clickHandler(yzm);
		returnValue.setState(CS.SUCCESS);
		returnValue.setMessage("点击发送信息!");
		return returnValue;
	}

	/**
	 * 非登录用户动态密码登录
	 */
	@Override
	public CsairReturnValue toLoginPhone(String username, String vcodeReg) {
		scl.URLPassengerInformation = null;
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = flightQueryPage.getHtmlPage();
		HtmlForm form = (HtmlForm) page.getByXPath("//form[@id='dynamicPswLogin']").get(0);
		flightQueryPage.setParent(form);
		HtmlInput phoneInput = (HtmlInput) form.getByXPath("//input[@id='mobile']").get(0);
		phoneInput.setValueAttribute(username);
		HtmlInput vcodeRegInput = (HtmlInput) form.getByXPath("//input[@id='vcode']").get(0);
		vcodeRegInput.setValueAttribute(vcodeReg);
		HtmlButton submitButton = (HtmlButton) form.getByXPath("//button[@id='dyn_btn_login']").get(0);
		page = clickHandler(submitButton);
		HtmlDivision erro = form.getFirstByXPath("//div[@class='lg-msg error']");
		if (erro != null) {
			returnValue.setMessage(erro.asText());
			return returnValue;
		}
		for (int i = 0; i <= timeoutmax; i++) {
			if (scl.URLPassengerInformation != null) {
				log.info("动态登录成功!准备进入旅客信息页");
				returnValue = checkLoginReturnValue(returnValue);
				break;
			}
			synchronized (page) {
				try {
					page.wait(200);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
			log.info("动态登录中.....");
		}

		return returnValue;
	}

	/**
	 * 加载旅客信息页面
	 * 
	 * @return
	 */
	@Override
	public Map<String, Object> toaddpassenger() {
		Map<String, Object> map = new HashMap<String, Object>();
		log.info("加载旅客信息页面url:" + scl.URLPassengerInformation);
		if (scl.URLPassengerInformation != null) {
			long t1 = System.currentTimeMillis();
			passengerInformationPage = webClient.getCsairHtmlPage(scl.URLPassengerInformation,
					"URLPassengerInformation", false);
			CS cs = loadPageHandler(passengerInformationPage, "//table[@class='summary-sub']");
			try {
				Thread.sleep(500);
			} catch (InterruptedException e1) {

				e1.printStackTrace();
			}
			if (cs == CS.SUCCESS) {
				HtmlPage page = passengerInformationPage.getHtmlPage();
				// log.info(page.asXml());
				HtmlTable valid = page.getFirstByXPath("//table[@class='summary-sub']");
				if (valid != null) {
					long t2 = System.currentTimeMillis();
					HtmlDivision div = page.getFirstByXPath("//div[@class='flight-summary-box']");
					Document doc = Jsoup.parse(div.asXml());
					Elements boxes = doc.select("div#flight-summary-box .singleFlightBox");
					List<FlightInfo> fiList = new ArrayList<FlightInfo>();
					for (int i = 0; i < boxes.size(); i++) {
						FlightInfo flightInfo1 = new FlightInfo();
						Element tb = boxes.get(i);
						flightInfo1.flight_name = tb.select(".flight-name").get(0).text();
						Elements tds = tb.select("table td");
						Element td0 = tds.get(0);
						flightInfo1.qf_city = td0.select("span.flight-city").get(0).ownText();// 起飞城市
						flightInfo1.qf_time = td0.select("span.marginLeft").text();// 起飞时间flight-date
						flightInfo1.qf_date = td0.select("span.flight-date").text();// 起飞时间
						Element td1 = tds.get(1);
						flightInfo1.hbh = td1.select("span").text();
						Element td2 = tds.get(2);
						flightInfo1.dd_city = td2.select("span.flight-city").get(0).ownText();// 到达城市
						flightInfo1.dd_time = td2.select("span.marginLeft").text();// 到达时间
						flightInfo1.dd_date = td2.select("span.flight-date").text();// 到达时间
						Element td3 = tds.get(3);
						flightInfo1.cx = td3.select("span").text();
						fiList.add(flightInfo1);
					}
					// 概述完成
					FlightInfo flightInfo = new FlightInfo();
					Elements subTbs = doc.select("div#summary-sub-box table tr");
					for (int k = 1; k < subTbs.size(); k++) {
						Element tr = subTbs.get(k);
						flightInfo.infos[k - 1].lk = tr.select("td").get(0).text();
						flightInfo.infos[k - 1].pj = tr.select("td").get(1).text();
						flightInfo.infos[k - 1].ryf = tr.select("td").get(2).text();
						flightInfo.infos[k - 1].jcs = tr.select("td").get(3).text();
						flightInfo.infos[k - 1].bxf = tr.select("td").get(4).text();
					}
					flightInfo.total = doc.select("div#price-total span").text();
					
					//常用旅客
					map.put("cpDiv", 0);
					HtmlDivision commonPassengerListDiv = (HtmlDivision) page.getElementById("common-passenger-list");
					if(commonPassengerListDiv != null ) {
						List<CommonPassenger> cpList = new ArrayList<CommonPassenger>();
						for (int i = 0; i < timeoutmax; i++) {
							DomNodeList<HtmlElement> as = commonPassengerListDiv.getElementsByTagName("a");
//							log.info("as.size()===>"+as.size());
							if(scl.getSvcEPassenger != null && as.size() != 0) {
								for (int i1 = 0; i1 < as.size(); i1++) {
									CommonPassenger commonPassenger = new CommonPassenger();
									String id = as.get(i1).getAttribute("id");
									String name = as.get(i1).asText();
									String aclass = as.get(i1).getAttribute("class");
									if(aclass.contains("used")) {
										commonPassenger.setChecked("checked");
									}
//									log.info("id====>"+id+",name===>"+name);
									commonPassenger.setId(id);
									commonPassenger.setName(name);
									cpList.add(commonPassenger);
								}
								map.put("cpDiv", 1);
								map.put("cpList", cpList);
								break;
							}
							synchronized (page) {
								try {
									page.wait(500);
								} catch (InterruptedException e) {
									// TODO Auto-generated catch block
									e.printStackTrace();
								}
								log.info("加载常用旅客信息......");
							}
						}
						
					}
					
					
					List<FlightPassenger> fpList = new ArrayList<FlightPassenger>();
					HtmlElement ulList = (HtmlElement) page.getElementById("passenger-list");
					Document doc1 = Jsoup.parse(ulList.asXml());
					Elements lis = doc1.select("li");
					for (int k = 0; k < lis.size(); k++) {
						FlightPassenger flightPassenger = new FlightPassenger();
						Element li = lis.get(k);
//						log.info(li.toString());
						flightPassenger.pType = li.attr("data-type");
//						log.info("flightPassenger.pType==>" + flightPassenger.pType);
						flightPassenger.name = li.select("input[name=psgName]").first().val();
//						log.info("name====>" + flightPassenger.name);
						flightPassenger.pIdType = li.select("div.select-trigger").get(1).text();
//						log.info("flightPassenger.pIdType==>" + flightPassenger.pIdType);
						flightPassenger.idNO = li.select("input[name=pIdCard]").first().val();
//						log.info("idNo====>" + flightPassenger.idNO);

						if (li.select("input[name=pBirthday]").size() != 0) {
							flightPassenger.birthday = li.select("input[name=pBirthday]").first().val();
//							log.info("出生日期==>" + flightPassenger.birthday);
						}

						if (li.select("div.psgs-carryByName").size() != 0) {
							flightPassenger.takeName = li.select("div.psgs-carryByName").first().html();
//							log.info("婴儿携带者===>" + flightPassenger.takeName);
						}
						flightPassenger.liId = li.attr("id");
						log.info("flightPassenger.liId==>" + flightPassenger.liId);

						flightPassenger.ir0Id = li.select("input.check-box-icon").get(0).attr("id");
						int size = li.select("input.check-box-icon").size();// 保险个数
						log.info("保险个数====>" + size);
						log.info("flightPassenger.ir0Id==>" + flightPassenger.ir0Id);

						HtmlInput zhx = (HtmlInput) page.getBody().getElementsByAttribute("input", "data-value", "a")
								.get(k);
						flightPassenger.ir0Check = zhx.isChecked();
						log.info("综合险check====>" + flightPassenger.ir0Check);

						flightPassenger.ir0Money = li.select("span.yellow-text").get(0).text();
						log.info("综合险金额===>" + flightPassenger.ir0Money);

						if (size == 2) {
							flightPassenger.ir1Id = li.select("input.check-box-icon").get(1).attr("id");
							log.info("flightPassenger.ir1Id==>" + flightPassenger.ir1Id);

							HtmlInput tpx = (HtmlInput) page.getBody()
									.getElementsByAttribute("input", "data-value", "b").get(k);
							flightPassenger.ir1Check = tpx.isChecked();
							log.info("退票险check====>" + flightPassenger.ir1Check);

							flightPassenger.ir1Money = li.select("span.yellow-text").get(1).text();
							log.info("退票险金额==>" + flightPassenger.ir1Money);
						}

						fpList.add(flightPassenger);
					}
					
					HtmlInput contact_nameInput = (HtmlInput) page.getElementById("contact_name");
					String contact_name = contact_nameInput.getAttribute("value");
					map.put("contact_name", contact_name);
					log.info("contact_name==>" + contact_name);
//					HtmlInput contact_moblieInput = (HtmlInput) page.getElementById("contact-moblie");
//					String contact_moblie = contact_moblieInput.getAttribute("mobile");
//					map.put("contact_moblie", contact_moblie);
//					log.info("contact_moblie==>" + contact_moblie);
//					HtmlInput emailInput = (HtmlInput) page.getElementById("email");
//					String email = emailInput.getAttribute("email");
//					map.put("email", email);
//					log.info("email==>" + email);
					
					passengerInformationPage.setLS(CS.SUCCESS);
					log.info(passengerInformationPage.getLS());
					map.put("filist", fiList);
					map.put("flightInfo", flightInfo);
					map.put("fplist", fpList);
					long t3 = System.currentTimeMillis();
					double chuliTime =  ((t3-t2)/1000.0);
					double totleTime = ((t3-t1)/1000.0);
					double nanhangTime = totleTime - chuliTime;
					log.info("南航官网用时："+nanhangTime+"s,无障碍处理用时："+chuliTime+"s,总用时："+totleTime+"s");
					
					map.put("Time", "南航官网用时："+nanhangTime+"s,无障碍处理用时："+chuliTime+"s,总用时："+totleTime+"s");
					return map;
				}
				synchronized (page) {
					try {
						page.wait(waittime);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
					passengerInformationPage.setLS(CS.LOADING);
				}
			}
			passengerInformationPage.setLS(CS.TIMEOUT);
			log.info(passengerInformationPage.getLS());
		}
		return null;
	}

	/**
	 * 添加乘客填写内容
	 */
	@Override
	public CsairReturnValue addpassenger(List<Passenger> list) {
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = passengerInformationPage.getHtmlPage();
//		HtmlDivision div = page.getFirstByXPath("//div[@id='passenger-block']");
//		passengerInformationPage.setParent(div);

 		for (int i = 0; i < list.size(); i++) {
			Passenger p = list.get(i);
			HtmlInput psgNameInput = (HtmlInput)page.getBody().getElementsByAttribute("input", "name", "psgName").get(i);
			psgNameInput.setValueAttribute(p.getPsgName());

			HtmlInput pIdCardInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "name", "pIdCard").get(i);
			pIdCardInput.setValueAttribute(p.getpIdCard());
		}
		returnValue.setState(CS.SUCCESS);
		return returnValue;
	}

	/**
	 * 添加乘客
	 */
	@Override
	public Map<String, Object> addpassengerloadFilightInfo() {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = passengerInformationPage.getHtmlPage();
		HtmlButton addButton = page.getFirstByXPath("//button[@id='addNewPsg']");
		clickHandler(addButton);

		for (int j = 0; j <= 100; j++) {
			HtmlTable valid = page.getFirstByXPath("//table[@class='summary-sub']");
			if (valid != null) {
				HtmlDivision div = page.getFirstByXPath("//div[@class='flight-summary-box']");
				Document doc = Jsoup.parse(div.asXml());
				Elements boxes = doc.select("div#flight-summary-box .singleFlightBox");
				List<FlightInfo> fiList = new ArrayList<FlightInfo>();
				for (int i = 0; i < boxes.size(); i++) {
					FlightInfo flightInfo1 = new FlightInfo();
					Element tb = boxes.get(i);
					flightInfo1.flight_name = tb.select(".flight-name").get(0).text();
					Elements tds = tb.select("table td");
					Element td0 = tds.get(0);
					flightInfo1.qf_city = td0.select("span.flight-city").get(0).ownText();// 起飞城市
					flightInfo1.qf_time = td0.select("span.marginLeft").text();// 起飞时间flight-date
					flightInfo1.qf_date = td0.select("span.flight-date").text();// 起飞时间
					Element td1 = tds.get(1);
					flightInfo1.hbh = td1.select("span").text();
					Element td2 = tds.get(2);
					flightInfo1.dd_city = td2.select("span.flight-city").get(0).ownText();// 到达城市
					flightInfo1.dd_time = td2.select("span.marginLeft").text();// 到达时间
					flightInfo1.dd_date = td2.select("span.flight-date").text();// 到达时间
					Element td3 = tds.get(3);
					flightInfo1.cx = td3.select("span").text();
					fiList.add(flightInfo1);
				}
				// 概述完成
				FlightInfo flightInfo = new FlightInfo();
				Elements subTbs = doc.select("div#summary-sub-box table tr");
				for (int k = 1; k < subTbs.size(); k++) {
					Element tr = subTbs.get(k);
					flightInfo.infos[k - 1].lk = tr.select("td").get(0).text();
					flightInfo.infos[k - 1].pj = tr.select("td").get(1).text();
					flightInfo.infos[k - 1].ryf = tr.select("td").get(2).text();
					flightInfo.infos[k - 1].jcs = tr.select("td").get(3).text();
					flightInfo.infos[k - 1].bxf = tr.select("td").get(4).text();
				}
				flightInfo.total = doc.select("div#price-total span").text();
				
				//常用旅客
				map.put("cpDiv", 0);
				Elements commonPassengerListDivs = doc.select("div#common-passenger-list");
				if(commonPassengerListDivs.size() != 0 ) {
					Element commonPassengerListDiv = commonPassengerListDivs.get(0);
					List<CommonPassenger> cpList = new ArrayList<CommonPassenger>();
					Elements as = commonPassengerListDiv.select("a");
					for (int i = 0; i < as.size(); i++) {
						CommonPassenger commonPassenger = new CommonPassenger();
						String id = as.get(i).attr("id");
						String name = as.get(i).text();
						String aclass = as.get(i).attr("class");
						if(aclass.contains("used")) {
							commonPassenger.setChecked("checked");
						}
						log.info("id====>"+id+",name===>"+name);
						commonPassenger.setId(id);
						commonPassenger.setName(name);
						cpList.add(commonPassenger);
					}
					map.put("cpDiv", 1);
					map.put("cpList", cpList);
				}
				

				List<FlightPassenger> fpList = new ArrayList<FlightPassenger>();
				HtmlElement ulList = (HtmlElement) page.getElementById("passenger-list");
				Document doc1 = Jsoup.parse(ulList.asXml());
				Elements lis = doc1.select("li");
				for (int k = 0; k < lis.size(); k++) {
					FlightPassenger flightPassenger = new FlightPassenger();
					Element li = lis.get(k);
//					log.info(li.toString());
					flightPassenger.pType = li.attr("data-type");
//					log.info("flightPassenger.pType==>" + flightPassenger.pType);
					flightPassenger.name = li.select("input[name=psgName]").first().val();
//					log.info("name====>" + flightPassenger.name);
					flightPassenger.pIdType = li.select("div.select-trigger").get(1).text();
//					log.info("flightPassenger.pIdType==>" + flightPassenger.pIdType);
					flightPassenger.idNO = li.select("input[name=pIdCard]").first().val();
//					log.info("idNo====>" + flightPassenger.idNO);

					if (li.select("input[name=pBirthday]").size() != 0) {
						flightPassenger.birthday = li.select("input[name=pBirthday]").first().val();
	//					log.info("出生日期==>" + flightPassenger.birthday);
					}

					if (li.select("div.psgs-carryByName").size() != 0) {
						flightPassenger.takeName = li.select("div.psgs-carryByName").first().html();
	//					log.info("婴儿携带者===>" + flightPassenger.takeName);
					}
					flightPassenger.liId = li.attr("id");
					log.info("flightPassenger.liId==>" + flightPassenger.liId);

					flightPassenger.ir0Id = li.select("input.check-box-icon").get(0).attr("id");
					int size = li.select("input.check-box-icon").size();// 保险个数
					log.info("保险个数====>" + size);
					log.info("flightPassenger.ir0Id==>" + flightPassenger.ir0Id);

					HtmlInput zhx = (HtmlInput) page.getBody().getElementsByAttribute("input", "data-value", "a")
							.get(k);
					flightPassenger.ir0Check = zhx.isChecked();
					log.info("综合险check====>" + flightPassenger.ir0Check);

					flightPassenger.ir0Money = li.select("span.yellow-text").get(0).text();
					log.info("综合险金额===>" + flightPassenger.ir0Money);

					if (size == 2) {
						flightPassenger.ir1Id = li.select("input.check-box-icon").get(1).attr("id");
						log.info("flightPassenger.ir1Id==>" + flightPassenger.ir1Id);

						HtmlInput tpx = (HtmlInput) page.getBody().getElementsByAttribute("input", "data-value", "b")
								.get(k);
						flightPassenger.ir1Check = tpx.isChecked();
						log.info("退票险check====>" + flightPassenger.ir1Check);

						flightPassenger.ir1Money = li.select("span.yellow-text").get(1).text();
						log.info("退票险金额==>" + flightPassenger.ir1Money);
					}

					fpList.add(flightPassenger);
				}
				
				HtmlInput contact_nameInput = (HtmlInput) page.getElementById("contact_name");
				String contact_name = contact_nameInput.getAttribute("value");
				map.put("contact_name", contact_name);
				log.info("contact_name==>" + contact_name);
//				HtmlInput contact_moblieInput = (HtmlInput) page.getElementById("contact-moblie");
//				String contact_moblie = contact_moblieInput.getAttribute("mobile");
//				map.put("contact_moblie", contact_moblie);
//				log.info("contact_moblie==>" + contact_moblie);
//				HtmlInput emailInput = (HtmlInput) page.getElementById("email");
//				String email = emailInput.getAttribute("email");
//				map.put("email", email);
//				log.info("email==>" + email);
				
				
				passengerInformationPage.setLS(CS.SUCCESS);
				log.info(passengerInformationPage.getLS());
				map.put("filist", fiList);
				map.put("flightInfo", flightInfo);
				map.put("fplist", fpList);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				passengerInformationPage.setLS(CS.LOADING);
			}
		}
		passengerInformationPage.setLS(CS.TIMEOUT);
		log.info(passengerInformationPage.getLS());
		return null;
	}

	/**
	 * 点击综合险
	 */
	@Override
	public Map<String, Object> checkBoxloadFilightInfo(String checkBoxId) {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = passengerInformationPage.getHtmlPage();
		HtmlInput checkInput = page.getFirstByXPath("//input[@id='" + checkBoxId + "']");
		clickHandler(checkInput);
		for (int j = 0; j <= 100; j++) {
			HtmlTable valid = page.getFirstByXPath("//table[@class='summary-sub']");
			if (valid != null) {
				HtmlDivision div = page.getFirstByXPath("//div[@class='flight-summary-box']");
				Document doc = Jsoup.parse(div.asXml());
				Elements boxes = doc.select("div#flight-summary-box .singleFlightBox");
				List<FlightInfo> fiList = new ArrayList<FlightInfo>();
				for (int i = 0; i < boxes.size(); i++) {
					FlightInfo flightInfo1 = new FlightInfo();
					Element tb = boxes.get(i);
					flightInfo1.flight_name = tb.select(".flight-name").get(0).text();
					Elements tds = tb.select("table td");
					Element td0 = tds.get(0);
					flightInfo1.qf_city = td0.select("span.flight-city").get(0).ownText();// 起飞城市
					flightInfo1.qf_time = td0.select("span.marginLeft").text();// 起飞时间flight-date
					flightInfo1.qf_date = td0.select("span.flight-date").text();// 起飞时间
					Element td1 = tds.get(1);
					flightInfo1.hbh = td1.select("span").text();
					Element td2 = tds.get(2);
					flightInfo1.dd_city = td2.select("span.flight-city").get(0).ownText();// 到达城市
					flightInfo1.dd_time = td2.select("span.marginLeft").text();// 到达时间
					flightInfo1.dd_date = td2.select("span.flight-date").text();// 到达时间
					Element td3 = tds.get(3);
					flightInfo1.cx = td3.select("span").text();
					fiList.add(flightInfo1);
				}
				// 概述完成
				FlightInfo flightInfo = new FlightInfo();
				Elements subTbs = doc.select("div#summary-sub-box table tr");
				for (int k = 1; k < subTbs.size(); k++) {
					Element tr = subTbs.get(k);
					flightInfo.infos[k - 1].lk = tr.select("td").get(0).text();
					flightInfo.infos[k - 1].pj = tr.select("td").get(1).text();
					flightInfo.infos[k - 1].ryf = tr.select("td").get(2).text();
					flightInfo.infos[k - 1].jcs = tr.select("td").get(3).text();
					flightInfo.infos[k - 1].bxf = tr.select("td").get(4).text();
//					log.info(flightInfo.infos);
				}
				flightInfo.total = doc.select("div#price-total span").text();
				
				//常用旅客
				map.put("cpDiv", 0);
				Elements commonPassengerListDivs = doc.select("div#common-passenger-list");
				if(commonPassengerListDivs.size() != 0 ) {
					Element commonPassengerListDiv = commonPassengerListDivs.get(0);
					List<CommonPassenger> cpList = new ArrayList<CommonPassenger>();
					Elements as = commonPassengerListDiv.select("a");
					for (int i = 0; i < as.size(); i++) {
						CommonPassenger commonPassenger = new CommonPassenger();
						String id = as.get(i).attr("id");
						String name = as.get(i).text();
						String aclass = as.get(i).attr("class");
						if(aclass.contains("used")) {
							commonPassenger.setChecked("checked");
						}
						log.info("id====>"+id+",name===>"+name);
						commonPassenger.setId(id);
						commonPassenger.setName(name);
						cpList.add(commonPassenger);
					}
					map.put("cpDiv", 1);
					map.put("cpList", cpList);
				}
				

				List<FlightPassenger> fpList = new ArrayList<FlightPassenger>();
				HtmlElement ulList = (HtmlElement) page.getElementById("passenger-list");
				Document doc1 = Jsoup.parse(ulList.asXml());
				Elements lis = doc1.select("li");
				for (int k = 0; k < lis.size(); k++) {
					FlightPassenger flightPassenger = new FlightPassenger();
					Element li = lis.get(k);
//					log.info(li.toString());
					flightPassenger.pType = li.attr("data-type");
//					log.info("flightPassenger.pType==>" + flightPassenger.pType);
					flightPassenger.name = li.select("input[name=psgName]").first().val();
//					log.info("name====>" + flightPassenger.name);
					flightPassenger.pIdType = li.select("div.select-trigger").get(1).text();
//					log.info("flightPassenger.pIdType==>" + flightPassenger.pIdType);
					flightPassenger.idNO = li.select("input[name=pIdCard]").first().val();
//					log.info("idNo====>" + flightPassenger.idNO);

					if (li.select("input[name=pBirthday]").size() != 0) {
						flightPassenger.birthday = li.select("input[name=pBirthday]").first().val();
//						log.info("出生日期==>" + flightPassenger.birthday);
					}

					if (li.select("div.psgs-carryByName").size() != 0) {
						flightPassenger.takeName = li.select("div.psgs-carryByName").first().html();
//						log.info("婴儿携带者===>" + flightPassenger.takeName);
					}
					flightPassenger.liId = li.attr("id");
					log.info("flightPassenger.liId==>" + flightPassenger.liId);

					flightPassenger.ir0Id = li.select("input.check-box-icon").get(0).attr("id");
					int size = li.select("input.check-box-icon").size();// 保险个数
					log.info("保险个数====>" + size);
					log.info("flightPassenger.ir0Id==>" + flightPassenger.ir0Id);

					HtmlInput zhx = (HtmlInput) page.getBody().getElementsByAttribute("input", "data-value", "a")
							.get(k);
					flightPassenger.ir0Check = zhx.isChecked();
					log.info("综合险check====>" + flightPassenger.ir0Check);

					flightPassenger.ir0Money = li.select("span.yellow-text").get(0).text();
					log.info("综合险金额===>" + flightPassenger.ir0Money);

					if (size == 2) {
						flightPassenger.ir1Id = li.select("input.check-box-icon").get(1).attr("id");
						log.info("flightPassenger.ir1Id==>" + flightPassenger.ir1Id);

						HtmlInput tpx = (HtmlInput) page.getBody().getElementsByAttribute("input", "data-value", "b")
								.get(k);
						flightPassenger.ir1Check = tpx.isChecked();
						log.info("退票险check====>" + flightPassenger.ir1Check);

						flightPassenger.ir1Money = li.select("span.yellow-text").get(1).text();
						log.info("退票险金额==>" + flightPassenger.ir1Money);
					}

					fpList.add(flightPassenger);
				}
				
				HtmlInput contact_nameInput = (HtmlInput) page.getElementById("contact_name");
				String contact_name = contact_nameInput.getAttribute("value");
				map.put("contact_name", contact_name);
				log.info("contact_name==>" + contact_name);
//				HtmlInput contact_moblieInput = (HtmlInput) page.getElementById("contact-moblie");
//				String contact_moblie = contact_moblieInput.getAttribute("mobile");
//				map.put("contact_moblie", contact_moblie);
//				log.info("contact_moblie==>" + contact_moblie);
//				HtmlInput emailInput = (HtmlInput) page.getElementById("email");
//				String email = emailInput.getAttribute("email");
//				map.put("email", email);
//				log.info("email==>" + email);
				
				passengerInformationPage.setLS(CS.SUCCESS);
				log.info(passengerInformationPage.getLS());
				map.put("filist", fiList);
				map.put("flightInfo", flightInfo);
				map.put("fplist", fpList);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				passengerInformationPage.setLS(CS.LOADING);
			}
		}
		passengerInformationPage.setLS(CS.TIMEOUT);
		log.info(passengerInformationPage.getLS());
		return null;
	}

	/**
	 * 点击退票险
	 */
	@Override
	public Map<String, Object> ir1checkBoxloadFilightInfo(String checkBoxId) {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = passengerInformationPage.getHtmlPage();
		HtmlInput checkInput = page.getFirstByXPath("//input[@id='" + checkBoxId + "']");
		clickHandler(checkInput);

		for (int j = 0; j <= 100; j++) {
			HtmlTable valid = page.getFirstByXPath("//table[@class='summary-sub']");
			if (valid != null) {
				HtmlDivision div = page.getFirstByXPath("//div[@class='flight-summary-box']");
				Document doc = Jsoup.parse(div.asXml());
				Elements boxes = doc.select("div#flight-summary-box .singleFlightBox");
				List<FlightInfo> fiList = new ArrayList<FlightInfo>();
				for (int i = 0; i < boxes.size(); i++) {
					FlightInfo flightInfo1 = new FlightInfo();
					Element tb = boxes.get(i);
					flightInfo1.flight_name = tb.select(".flight-name").get(0).text();
					Elements tds = tb.select("table td");
					Element td0 = tds.get(0);
					flightInfo1.qf_city = td0.select("span.flight-city").get(0).ownText();// 起飞城市
					flightInfo1.qf_time = td0.select("span.marginLeft").text();// 起飞时间flight-date
					flightInfo1.qf_date = td0.select("span.flight-date").text();// 起飞时间
					Element td1 = tds.get(1);
					flightInfo1.hbh = td1.select("span").text();
					Element td2 = tds.get(2);
					flightInfo1.dd_city = td2.select("span.flight-city").get(0).ownText();// 到达城市
					flightInfo1.dd_time = td2.select("span.marginLeft").text();// 到达时间
					flightInfo1.dd_date = td2.select("span.flight-date").text();// 到达时间
					Element td3 = tds.get(3);
					flightInfo1.cx = td3.select("span").text();
					fiList.add(flightInfo1);
				}
				// 概述完成
				FlightInfo flightInfo = new FlightInfo();
				Elements subTbs = doc.select("div#summary-sub-box table tr");
				for (int k = 1; k < subTbs.size(); k++) {
					Element tr = subTbs.get(k);
					flightInfo.infos[k - 1].lk = tr.select("td").get(0).text();
					flightInfo.infos[k - 1].pj = tr.select("td").get(1).text();
					flightInfo.infos[k - 1].ryf = tr.select("td").get(2).text();
					flightInfo.infos[k - 1].jcs = tr.select("td").get(3).text();
					flightInfo.infos[k - 1].bxf = tr.select("td").get(4).text();
//					log.info(flightInfo.infos);
				}
				flightInfo.total = doc.select("div#price-total span").text();
				
				//常用旅客
				map.put("cpDiv", 0);
				Elements commonPassengerListDivs = doc.select("div#common-passenger-list");
				if(commonPassengerListDivs.size() != 0 ) {
					Element commonPassengerListDiv = commonPassengerListDivs.get(0);
					List<CommonPassenger> cpList = new ArrayList<CommonPassenger>();
					Elements as = commonPassengerListDiv.select("a");
					for (int i = 0; i < as.size(); i++) {
						CommonPassenger commonPassenger = new CommonPassenger();
						String id = as.get(i).attr("id");
						String name = as.get(i).text();
						String aclass = as.get(i).attr("class");
						if(aclass.contains("used")) {
							commonPassenger.setChecked("checked");
						}
						log.info("id====>"+id+",name===>"+name);
						commonPassenger.setId(id);
						commonPassenger.setName(name);
						cpList.add(commonPassenger);
					}
					map.put("cpDiv", 1);
					map.put("cpList", cpList);
				}
				

				List<FlightPassenger> fpList = new ArrayList<FlightPassenger>();
				HtmlElement ulList = (HtmlElement) page.getElementById("passenger-list");
				Document doc1 = Jsoup.parse(ulList.asXml());
				Elements lis = doc1.select("li");
				for (int k = 0; k < lis.size(); k++) {
					FlightPassenger flightPassenger = new FlightPassenger();
					Element li = lis.get(k);
//					log.info(li.toString());
					flightPassenger.pType = li.attr("data-type");
//					log.info("flightPassenger.pType==>" + flightPassenger.pType);
					flightPassenger.name = li.select("input[name=psgName]").first().val();
//					log.info("name====>" + flightPassenger.name);
					flightPassenger.pIdType = li.select("div.select-trigger").get(1).text();
//					log.info("flightPassenger.pIdType==>" + flightPassenger.pIdType);
					flightPassenger.idNO = li.select("input[name=pIdCard]").first().val();
//					log.info("idNo====>" + flightPassenger.idNO);

					if (li.select("input[name=pBirthday]").size() != 0) {
						flightPassenger.birthday = li.select("input[name=pBirthday]").first().val();
//						log.info("出生日期==>" + flightPassenger.birthday);
					}

					if (li.select("div.psgs-carryByName").size() != 0) {
						flightPassenger.takeName = li.select("div.psgs-carryByName").first().html();
//						log.info("婴儿携带者===>" + flightPassenger.takeName);
					}
					flightPassenger.liId = li.attr("id");
					log.info("flightPassenger.liId==>" + flightPassenger.liId);

					flightPassenger.ir0Id = li.select("input.check-box-icon").get(0).attr("id");
					int size = li.select("input.check-box-icon").size();// 保险个数
					log.info("保险个数====>" + size);
					log.info("flightPassenger.ir0Id==>" + flightPassenger.ir0Id);

					HtmlInput zhx = (HtmlInput) page.getBody().getElementsByAttribute("input", "data-value", "a")
							.get(k);
					flightPassenger.ir0Check = zhx.isChecked();
					log.info("综合险check====>" + flightPassenger.ir0Check);

					flightPassenger.ir0Money = li.select("span.yellow-text").get(0).text();
					log.info("综合险金额===>" + flightPassenger.ir0Money);

					if (size == 2) {
						flightPassenger.ir1Id = li.select("input.check-box-icon").get(1).attr("id");
						log.info("flightPassenger.ir1Id==>" + flightPassenger.ir1Id);

						HtmlInput tpx = (HtmlInput) page.getBody().getElementsByAttribute("input", "data-value", "b")
								.get(k);
						flightPassenger.ir1Check = tpx.isChecked();
						log.info("退票险check====>" + flightPassenger.ir1Check);

						flightPassenger.ir1Money = li.select("span.yellow-text").get(1).text();
						log.info("退票险金额==>" + flightPassenger.ir1Money);
					}

					fpList.add(flightPassenger);
				}
				
				HtmlInput contact_nameInput = (HtmlInput) page.getElementById("contact_name");
				String contact_name = contact_nameInput.getAttribute("value");
				map.put("contact_name", contact_name);
				log.info("contact_name==>" + contact_name);
//				HtmlInput contact_moblieInput = (HtmlInput) page.getElementById("contact-moblie");
//				String contact_moblie = contact_moblieInput.getAttribute("mobile");
//				map.put("contact_moblie", contact_moblie);
//				log.info("contact_moblie==>" + contact_moblie);
//				HtmlInput emailInput = (HtmlInput) page.getElementById("email");
//				String email = emailInput.getAttribute("email");
//				map.put("email", email);
//				log.info("email==>" + email);
				
				passengerInformationPage.setLS(CS.SUCCESS);
				log.info(passengerInformationPage.getLS());
				map.put("filist", fiList);
				map.put("flightInfo", flightInfo);
				map.put("fplist", fpList);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				passengerInformationPage.setLS(CS.LOADING);
			}
		}
		passengerInformationPage.setLS(CS.TIMEOUT);
		log.info(passengerInformationPage.getLS());
		return null;
	}

	/**
	 * 点击删除
	 */
	@Override
	public Map<String, Object> delloadFilightInfo(String divId) {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = passengerInformationPage.getHtmlPage();
		HtmlElement li1 = page.getFirstByXPath("//li[@id='" + divId + "']");
		passengerInformationPage.setParent(li1);
		List<HtmlElement> delDivs = li1.getElementsByAttribute("div", "class", "del-psg-block p-del");
		HtmlDivision delDiv = (HtmlDivision) delDivs.get(0);
		clickHandler(delDiv);
		try {
			Thread.sleep(500);
		} catch (InterruptedException e1) {
			e1.printStackTrace();
		}
		for (int j = 0; j <= 100; j++) {
			HtmlTable valid = page.getFirstByXPath("//table[@class='summary-sub']");
			if (valid != null) {
				HtmlDivision div = page.getFirstByXPath("//div[@class='flight-summary-box']");
				Document doc = Jsoup.parse(div.asXml());
				Elements boxes = doc.select("div#flight-summary-box .singleFlightBox");
				List<FlightInfo> fiList = new ArrayList<FlightInfo>();
				for (int i = 0; i < boxes.size(); i++) {
					FlightInfo flightInfo1 = new FlightInfo();
					Element tb = boxes.get(i);
					flightInfo1.flight_name = tb.select(".flight-name").get(0).text();
					Elements tds = tb.select("table td");
					Element td0 = tds.get(0);
					flightInfo1.qf_city = td0.select("span.flight-city").get(0).ownText();// 起飞城市
					flightInfo1.qf_time = td0.select("span.marginLeft").text();// 起飞时间flight-date
					flightInfo1.qf_date = td0.select("span.flight-date").text();// 起飞时间
					Element td1 = tds.get(1);
					flightInfo1.hbh = td1.select("span").text();
					Element td2 = tds.get(2);
					flightInfo1.dd_city = td2.select("span.flight-city").get(0).ownText();// 到达城市
					flightInfo1.dd_time = td2.select("span.marginLeft").text();// 到达时间
					flightInfo1.dd_date = td2.select("span.flight-date").text();// 到达时间
					Element td3 = tds.get(3);
					flightInfo1.cx = td3.select("span").text();
					fiList.add(flightInfo1);
				}
				// 概述完成
				FlightInfo flightInfo = new FlightInfo();
				Elements subTbs = doc.select("div#summary-sub-box table tr");
				for (int k = 1; k < subTbs.size(); k++) {
					Element tr = subTbs.get(k);
					flightInfo.infos[k - 1].lk = tr.select("td").get(0).text();
					flightInfo.infos[k - 1].pj = tr.select("td").get(1).text();
					flightInfo.infos[k - 1].ryf = tr.select("td").get(2).text();
					flightInfo.infos[k - 1].jcs = tr.select("td").get(3).text();
					flightInfo.infos[k - 1].bxf = tr.select("td").get(4).text();
//					log.info(flightInfo.infos);
				}
				flightInfo.total = doc.select("div#price-total span").text();
				
				//常用旅客
				map.put("cpDiv", 0);
				Elements commonPassengerListDivs = doc.select("div#common-passenger-list");
				if(commonPassengerListDivs.size() != 0 ) {
					Element commonPassengerListDiv = commonPassengerListDivs.get(0);
					List<CommonPassenger> cpList = new ArrayList<CommonPassenger>();
					Elements as = commonPassengerListDiv.select("a");
					for (int i = 0; i < as.size(); i++) {
						CommonPassenger commonPassenger = new CommonPassenger();
						String id = as.get(i).attr("id");
						String name = as.get(i).text();
						String aclass = as.get(i).attr("class");
						if(aclass.contains("used")) {
							commonPassenger.setChecked("checked");
						}
						log.info("id====>"+id+",name===>"+name);
						commonPassenger.setId(id);
						commonPassenger.setName(name);
						cpList.add(commonPassenger);
					}
					map.put("cpDiv", 1);
					map.put("cpList", cpList);
				}
				


				List<FlightPassenger> fpList = new ArrayList<FlightPassenger>();
				HtmlElement ulList = (HtmlElement) page.getElementById("passenger-list");
				Document doc1 = Jsoup.parse(ulList.asXml());
				Elements lis = doc1.select("li");
				for (int k = 0; k < lis.size(); k++) {
					FlightPassenger flightPassenger = new FlightPassenger();
					Element li = lis.get(k);
//					log.info(li.toString());
					flightPassenger.pType = li.attr("data-type");
//					log.info("flightPassenger.pType==>" + flightPassenger.pType);
					flightPassenger.name = li.select("input[name=psgName]").first().val();
//					log.info("name====>" + flightPassenger.name);
					flightPassenger.pIdType = li.select("div.select-trigger").get(1).text();
//					log.info("flightPassenger.pIdType==>" + flightPassenger.pIdType);
					flightPassenger.idNO = li.select("input[name=pIdCard]").first().val();
//					log.info("idNo====>" + flightPassenger.idNO);

					if (li.select("input[name=pBirthday]").size() != 0) {
						flightPassenger.birthday = li.select("input[name=pBirthday]").first().val();
//						log.info("出生日期==>" + flightPassenger.birthday);
					}

					if (li.select("div.psgs-carryByName").size() != 0) {
						flightPassenger.takeName = li.select("div.psgs-carryByName").first().html();
//						log.info("婴儿携带者===>" + flightPassenger.takeName);
					}
					flightPassenger.liId = li.attr("id");
					log.info("flightPassenger.liId==>" + flightPassenger.liId);

					flightPassenger.ir0Id = li.select("input.check-box-icon").get(0).attr("id");
					int size = li.select("input.check-box-icon").size();// 保险个数
					log.info("保险个数====>" + size);
					log.info("flightPassenger.ir0Id==>" + flightPassenger.ir0Id);

					HtmlInput zhx = (HtmlInput) page.getBody().getElementsByAttribute("input", "data-value", "a")
							.get(k);
					flightPassenger.ir0Check = zhx.isChecked();
					log.info("综合险check====>" + flightPassenger.ir0Check);

					flightPassenger.ir0Money = li.select("span.yellow-text").get(0).text();
					log.info("综合险金额===>" + flightPassenger.ir0Money);

					if (size == 2) {
						flightPassenger.ir1Id = li.select("input.check-box-icon").get(1).attr("id");
						log.info("flightPassenger.ir1Id==>" + flightPassenger.ir1Id);

						HtmlInput tpx = (HtmlInput) page.getBody().getElementsByAttribute("input", "data-value", "b")
								.get(k);
						flightPassenger.ir1Check = tpx.isChecked();
						log.info("退票险check====>" + flightPassenger.ir1Check);

						flightPassenger.ir1Money = li.select("span.yellow-text").get(1).text();
						log.info("退票险金额==>" + flightPassenger.ir1Money);
					}

					fpList.add(flightPassenger);
				}
				
				HtmlInput contact_nameInput = (HtmlInput) page.getElementById("contact_name");
				String contact_name = contact_nameInput.getAttribute("value");
				map.put("contact_name", contact_name);
				log.info("contact_name==>" + contact_name);
//				HtmlInput contact_moblieInput = (HtmlInput) page.getElementById("contact-moblie");
//				String contact_moblie = contact_moblieInput.getAttribute("mobile");
//				map.put("contact_moblie", contact_moblie);
//				log.info("contact_moblie==>" + contact_moblie);
//				HtmlInput emailInput = (HtmlInput) page.getElementById("email");
//				String email = emailInput.getAttribute("email");
//				map.put("email", email);
//				log.info("email==>" + email);
				
				passengerInformationPage.setLS(CS.SUCCESS);
				log.info(passengerInformationPage.getLS());
				map.put("filist", fiList);
				map.put("flightInfo", flightInfo);
				map.put("fplist", fpList);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				passengerInformationPage.setLS(CS.LOADING);
			}
		}
		passengerInformationPage.setLS(CS.TIMEOUT);
		log.info(passengerInformationPage.getLS());
		return null;
	}

	/**
	 * 变更人物类型
	 */
	public CsairReturnValue changePtype(String divId, String optionValue) {
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = passengerInformationPage.getHtmlPage();
		HtmlElement li = page.getFirstByXPath("//li[@id='" + divId + "']");
		passengerInformationPage.setParent(li);
		HtmlDivision select = (HtmlDivision) li.getElementsByAttribute("div", "class", "select-ico").get(0);
		clickHandler(select);
		List<Object> uls = page.getByXPath("//ul[@class='option-group']");
		for (Iterator<Object> iterator = uls.iterator(); iterator.hasNext();) {
			HtmlElement ul = (HtmlElement) iterator.next();
			String n = ul.getAttribute("name");
			if (n.equals(divId)) {
				String style = ul.getAttribute("style");
				String newStyle = style.replace("none", "block");
				ul.setAttribute("style", newStyle);
			}
			if (ul.getAttribute("style").contains("block")) {
				passengerInformationPage.setParent(ul);
				DomNodeList<DomNode> options = ul.getChildNodes();
				HtmlElement pli = (HtmlElement) options.get(Integer.valueOf(optionValue));
				clickHandler(pli);
				ul.setAttribute("name", divId);
				String style = ul.getAttribute("style");
				String newStyle = style.replace("block", "none");
				ul.setAttribute("style", newStyle);
				break;
			}
		}

		HtmlDivision alertBox = (HtmlDivision) page.getElementById("alert_box");// 弹框
		String alertBoxClass = alertBox.getAttribute("class");// 取弹框class属性
		HtmlButton popupWindowButton = (HtmlButton) page.getBody()
				.getElementsByAttribute("button", "otype", "popupWindow").get(0);// 弹框中"继续"按钮
		HtmlElement alertDiv = page.getBody().getElementsByAttribute("div", "class", "right confirm-info").get(0);// 弹框中内容提示
		if (!alertBoxClass.contains("hide")) {
			returnValue.setState(CS.FAIL);
			returnValue.setMessage(alertDiv.asText());
			clickHandler(popupWindowButton);
			return returnValue;
		}
		returnValue.setState(CS.SUCCESS);
		return returnValue;
	}

	/**
	 * 变更加人物/证件载页面
	 */
	@Override
	public Map<String, Object> changePtypeloadFilightInfo() {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = passengerInformationPage.getHtmlPage();

		for (int j = 0; j <= 100; j++) {
			HtmlTable valid = page.getFirstByXPath("//table[@class='summary-sub']");
			if (valid != null) {
				HtmlDivision div = page.getFirstByXPath("//div[@class='flight-summary-box']");
				Document doc = Jsoup.parse(div.asXml());
				Elements boxes = doc.select("div#flight-summary-box .singleFlightBox");
				List<FlightInfo> fiList = new ArrayList<FlightInfo>();
				for (int i = 0; i < boxes.size(); i++) {
					FlightInfo flightInfo1 = new FlightInfo();
					Element tb = boxes.get(i);
					flightInfo1.flight_name = tb.select(".flight-name").get(0).text();
					Elements tds = tb.select("table td");
					Element td0 = tds.get(0);
					flightInfo1.qf_city = td0.select("span.flight-city").get(0).ownText();// 起飞城市
					flightInfo1.qf_time = td0.select("span.marginLeft").text();// 起飞时间flight-date
					flightInfo1.qf_date = td0.select("span.flight-date").text();// 起飞时间
					Element td1 = tds.get(1);
					flightInfo1.hbh = td1.select("span").text();
					Element td2 = tds.get(2);
					flightInfo1.dd_city = td2.select("span.flight-city").get(0).ownText();// 到达城市
					flightInfo1.dd_time = td2.select("span.marginLeft").text();// 到达时间
					flightInfo1.dd_date = td2.select("span.flight-date").text();// 到达时间
					Element td3 = tds.get(3);
					flightInfo1.cx = td3.select("span").text();
					fiList.add(flightInfo1);
				}
				// 概述完成
				FlightInfo flightInfo = new FlightInfo();
				Elements subTbs = doc.select("div#summary-sub-box table tr");
				for (int k = 1; k < subTbs.size(); k++) {
					Element tr = subTbs.get(k);
					flightInfo.infos[k - 1].lk = tr.select("td").get(0).text();
					flightInfo.infos[k - 1].pj = tr.select("td").get(1).text();
					flightInfo.infos[k - 1].ryf = tr.select("td").get(2).text();
					flightInfo.infos[k - 1].jcs = tr.select("td").get(3).text();
					flightInfo.infos[k - 1].bxf = tr.select("td").get(4).text();
//					log.info(flightInfo.infos);
				}
				flightInfo.total = doc.select("div#price-total span").text();
				
				//常用旅客
				map.put("cpDiv", 0);
				Elements commonPassengerListDivs = doc.select("div#common-passenger-list");
				if(commonPassengerListDivs.size() != 0 ) {
					Element commonPassengerListDiv = commonPassengerListDivs.get(0);
					List<CommonPassenger> cpList = new ArrayList<CommonPassenger>();
					Elements as = commonPassengerListDiv.select("a");
					for (int i = 0; i < as.size(); i++) {
						CommonPassenger commonPassenger = new CommonPassenger();
						String id = as.get(i).attr("id");
						String name = as.get(i).text();
						String aclass = as.get(i).attr("class");
						if(aclass.contains("used")) {
							commonPassenger.setChecked("checked");
						}
						log.info("id====>"+id+",name===>"+name);
						commonPassenger.setId(id);
						commonPassenger.setName(name);
						cpList.add(commonPassenger);
					}
					map.put("cpDiv", 1);
					map.put("cpList", cpList);
				}
				

				List<FlightPassenger> fpList = new ArrayList<FlightPassenger>();
				HtmlElement ulList = (HtmlElement) page.getElementById("passenger-list");
				Document doc1 = Jsoup.parse(ulList.asXml());
				Elements lis = doc1.select("li");
				for (int k = 0; k < lis.size(); k++) {
					FlightPassenger flightPassenger = new FlightPassenger();
					Element li = lis.get(k);
//					log.info(li.toString());
					flightPassenger.pType = li.attr("data-type");
//					log.info("flightPassenger.pType==>" + flightPassenger.pType);
					flightPassenger.name = li.select("input[name=psgName]").first().val();
//					log.info("name====>" + flightPassenger.name);
					flightPassenger.pIdType = li.select("div.select-trigger").get(1).text();
//					log.info("flightPassenger.pIdType==>" + flightPassenger.pIdType);
					flightPassenger.idNO = li.select("input[name=pIdCard]").first().val();
//					log.info("idNo====>" + flightPassenger.idNO);

					if (li.select("input[name=pBirthday]").size() != 0) {
						flightPassenger.birthday = li.select("input[name=pBirthday]").first().val();
//						log.info("出生日期==>" + flightPassenger.birthday);
					}

					if (li.select("div.psgs-carryByName").size() != 0) {
						flightPassenger.takeName = li.select("div.psgs-carryByName").first().html();
//						log.info("婴儿携带者===>" + flightPassenger.takeName);
					}
					flightPassenger.liId = li.attr("id");
					log.info("flightPassenger.liId==>" + flightPassenger.liId);

					flightPassenger.ir0Id = li.select("input.check-box-icon").get(0).attr("id");
					int size = li.select("input.check-box-icon").size();// 保险个数
					log.info("保险个数====>" + size);
					log.info("flightPassenger.ir0Id==>" + flightPassenger.ir0Id);

					HtmlInput zhx = (HtmlInput) page.getBody().getElementsByAttribute("input", "data-value", "a")
							.get(k);
					flightPassenger.ir0Check = zhx.isChecked();
					log.info("综合险check====>" + flightPassenger.ir0Check);

					flightPassenger.ir0Money = li.select("span.yellow-text").get(0).text();
					log.info("综合险金额===>" + flightPassenger.ir0Money);

					if (size == 2) {
						flightPassenger.ir1Id = li.select("input.check-box-icon").get(1).attr("id");
						log.info("flightPassenger.ir1Id==>" + flightPassenger.ir1Id);

						HtmlInput tpx = (HtmlInput) page.getBody().getElementsByAttribute("input", "data-value", "b")
								.get(k);
						flightPassenger.ir1Check = tpx.isChecked();
						log.info("退票险check====>" + flightPassenger.ir1Check);

						flightPassenger.ir1Money = li.select("span.yellow-text").get(1).text();
						log.info("退票险金额==>" + flightPassenger.ir1Money);
					}

					fpList.add(flightPassenger);
				}
				
				HtmlInput contact_nameInput = (HtmlInput) page.getElementById("contact_name");
				String contact_name = contact_nameInput.getAttribute("value");
				map.put("contact_name", contact_name);
				log.info("contact_name==>" + contact_name);
//				HtmlInput contact_moblieInput = (HtmlInput) page.getElementById("contact-moblie");
//				String contact_moblie = contact_moblieInput.getAttribute("mobile");
//				map.put("contact_moblie", contact_moblie);
//				log.info("contact_moblie==>" + contact_moblie);
//				HtmlInput emailInput = (HtmlInput) page.getElementById("email");
//				String email = emailInput.getAttribute("email");
//				map.put("email", email);
//				log.info("email==>" + email);
				
				passengerInformationPage.setLS(CS.SUCCESS);
				log.info(passengerInformationPage.getLS());
				map.put("filist", fiList);
				map.put("flightInfo", flightInfo);
				map.put("fplist", fpList);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				passengerInformationPage.setLS(CS.LOADING);
			}
		}
		passengerInformationPage.setLS(CS.TIMEOUT);
		log.info(passengerInformationPage.getLS());
		return null;
	}
	
	/**--------------------------------------------------------------**/
	/**
	 * 点击常用旅客
	 */
	@Override
	public CsairReturnValue clickCommonPassenger(String id) {
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = passengerInformationPage.getHtmlPage();
//		log.info(page.asXml());
		log.info("id====>"+id);
		HtmlAnchor a = page.getFirstByXPath("//a[@id='" + id + "']");
		clickHandler(a);
		HtmlDivision alert_boxDiv= (HtmlDivision) page.getElementById("alert_box");
		String alert_boxDivClass = alert_boxDiv.getAttribute("class");
		HtmlButton popupWindowButton = (HtmlButton) page.getBody().getElementsByAttribute("button", "otype", "popupWindow").get(0);// 弹框中"继续"按钮
		HtmlElement alertDiv = page.getBody().getElementsByAttribute("div", "class", "right confirm-info").get(0);
		for (int i = 0; i < timeoutmax; i++) {
			if(scl.change3 != null) {
				if(alert_boxDivClass.contains("hide")) {
					returnValue.setState(CS.SUCCESS);
					return returnValue;
				}else {
					returnValue.setState(CS.FAIL);
					returnValue.setMessage(alertDiv.asText());
					clickHandler(popupWindowButton);
					return returnValue;
				}
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				log.info("点击常用旅客加载文件.....");
			}
		}
		
		return null;
	}

	/**
	 * 点击常用旅客加载
	 */
	@Override
	public Map<String, Object> clickCommonPassengerloadFilightInfo() {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = passengerInformationPage.getHtmlPage();

		for (int j = 0; j <= 100; j++) {
			HtmlTable valid = page.getFirstByXPath("//table[@class='summary-sub']");
			if (valid != null) {
				HtmlDivision div = page.getFirstByXPath("//div[@class='flight-summary-box']");
				Document doc = Jsoup.parse(div.asXml());
				Elements boxes = doc.select("div#flight-summary-box .singleFlightBox");
				List<FlightInfo> fiList = new ArrayList<FlightInfo>();
				for (int i = 0; i < boxes.size(); i++) {
					FlightInfo flightInfo1 = new FlightInfo();
					Element tb = boxes.get(i);
					flightInfo1.flight_name = tb.select(".flight-name").get(0).text();
					log.info("flightInfo1.flight_name("+i+")===>"+flightInfo1.flight_name);
					Elements tds = tb.select("table td");
					Element td0 = tds.get(0);
					flightInfo1.qf_city = td0.select("span.flight-city").get(0).ownText();// 起飞城市
					flightInfo1.qf_time = td0.select("span.marginLeft").text();// 起飞时间flight-date
					flightInfo1.qf_date = td0.select("span.flight-date").text();// 起飞时间
					Element td1 = tds.get(1);
					flightInfo1.hbh = td1.select("span").text();
					Element td2 = tds.get(2);
					flightInfo1.dd_city = td2.select("span.flight-city").get(0).ownText();// 到达城市
					flightInfo1.dd_time = td2.select("span.marginLeft").text();// 到达时间
					flightInfo1.dd_date = td2.select("span.flight-date").text();// 到达时间
					Element td3 = tds.get(3);
					flightInfo1.cx = td3.select("span").text();
					fiList.add(flightInfo1);
				}
				// 概述完成
				FlightInfo flightInfo = new FlightInfo();
				Elements subTbs = doc.select("div#summary-sub-box table tr");
				for (int k = 1; k < subTbs.size(); k++) {
					Element tr = subTbs.get(k);
					flightInfo.infos[k - 1].lk = tr.select("td").get(0).text();
					flightInfo.infos[k - 1].pj = tr.select("td").get(1).text();
					flightInfo.infos[k - 1].ryf = tr.select("td").get(2).text();
					flightInfo.infos[k - 1].jcs = tr.select("td").get(3).text();
					flightInfo.infos[k - 1].bxf = tr.select("td").get(4).text();
//					log.info(flightInfo.infos);
				}
				flightInfo.total = doc.select("div#price-total span").text();
				
				//常用旅客
				map.put("cpDiv", 0);
				Elements commonPassengerListDivs = doc.select("div#common-passenger-list");
				if(commonPassengerListDivs.size() != 0 ) {
					Element commonPassengerListDiv = commonPassengerListDivs.get(0);
					List<CommonPassenger> cpList = new ArrayList<CommonPassenger>();
					Elements as = commonPassengerListDiv.select("a");
					for (int i = 0; i < as.size(); i++) {
						CommonPassenger commonPassenger = new CommonPassenger();
						String id = as.get(i).attr("id");
						String name = as.get(i).text();
						String aclass = as.get(i).attr("class");
						if(aclass.contains("used")) {
							commonPassenger.setChecked("checked");
						}
						log.info("id====>"+id+",name===>"+name);
						commonPassenger.setId(id);
						commonPassenger.setName(name);
						cpList.add(commonPassenger);
					}
					map.put("cpDiv", 1);
					map.put("cpList", cpList);
				}
				
				List<FlightPassenger> fpList = new ArrayList<FlightPassenger>();
				HtmlElement ulList = (HtmlElement) page.getElementById("passenger-list");
				Document doc1 = Jsoup.parse(ulList.asXml());
				Elements lis = doc1.select("li");
				for (int k = 0; k < lis.size(); k++) {
					FlightPassenger flightPassenger = new FlightPassenger();
					Element li = lis.get(k);
//					log.info(li.toString());
					flightPassenger.pType = li.attr("data-type");
//					log.info("flightPassenger.pType==>" + flightPassenger.pType);
					flightPassenger.name = li.select("input[name=psgName]").first().val();
//					log.info("name====>" + flightPassenger.name);
					flightPassenger.pIdType = li.select("div.select-trigger").get(1).text();
//					log.info("flightPassenger.pIdType==>" + flightPassenger.pIdType);
					flightPassenger.idNO = li.select("input[name=pIdCard]").first().val();
//					log.info("idNo====>" + flightPassenger.idNO);

					if (li.select("input[name=pBirthday]").size() != 0) {
						flightPassenger.birthday = li.select("input[name=pBirthday]").first().val();
//						log.info("出生日期==>" + flightPassenger.birthday);
					}

					if (li.select("div.psgs-carryByName").size() != 0) {
						flightPassenger.takeName = li.select("div.psgs-carryByName").first().html();
//						log.info("婴儿携带者===>" + flightPassenger.takeName);
					}
					flightPassenger.liId = li.attr("id");
					log.info("flightPassenger.liId==>" + flightPassenger.liId);

					flightPassenger.ir0Id = li.select("input.check-box-icon").get(0).attr("id");
					int size = li.select("input.check-box-icon").size();// 保险个数
					log.info("保险个数====>" + size);
					log.info("flightPassenger.ir0Id==>" + flightPassenger.ir0Id);

					HtmlInput zhx = (HtmlInput) page.getBody().getElementsByAttribute("input", "data-value", "a")
							.get(k);
					flightPassenger.ir0Check = zhx.isChecked();
					log.info("综合险check====>" + flightPassenger.ir0Check);

					flightPassenger.ir0Money = li.select("span.yellow-text").get(0).text();
					log.info("综合险金额===>" + flightPassenger.ir0Money);

					if (size == 2) {
						flightPassenger.ir1Id = li.select("input.check-box-icon").get(1).attr("id");
						log.info("flightPassenger.ir1Id==>" + flightPassenger.ir1Id);

						HtmlInput tpx = (HtmlInput) page.getBody().getElementsByAttribute("input", "data-value", "b")
								.get(k);
						flightPassenger.ir1Check = tpx.isChecked();
						log.info("退票险check====>" + flightPassenger.ir1Check);

						flightPassenger.ir1Money = li.select("span.yellow-text").get(1).text();
						log.info("退票险金额==>" + flightPassenger.ir1Money);
					}

					fpList.add(flightPassenger);
				}
				
				HtmlInput contact_nameInput = (HtmlInput) page.getElementById("contact_name");
				String contact_name = contact_nameInput.getAttribute("value");
				map.put("contact_name", contact_name);
				log.info("contact_name==>" + contact_name);
//				HtmlInput contact_moblieInput = (HtmlInput) page.getElementById("contact-moblie");
//				String contact_moblie = contact_moblieInput.getAttribute("mobile");
//				map.put("contact_moblie", contact_moblie);
//				log.info("contact_moblie==>" + contact_moblie);
//				HtmlInput emailInput = (HtmlInput) page.getElementById("email");
//				String email = emailInput.getAttribute("email");
//				map.put("email", email);
//				log.info("email==>" + email);
				
				passengerInformationPage.setLS(CS.SUCCESS);
				log.info(passengerInformationPage.getLS());
				map.put("filist", fiList);
				map.put("flightInfo", flightInfo);
				map.put("fplist", fpList);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				passengerInformationPage.setLS(CS.LOADING);
			}
		}
		passengerInformationPage.setLS(CS.TIMEOUT);
		log.info(passengerInformationPage.getLS());
		return null;
	}
	
	/**
	 * 点击常用旅客加载WF
	 */
	@Override
	public Map<String, Object> clickCommonPassengerWFloadFilightInfo() {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = passengerInformationPage.getHtmlPage();
		
		for (int j = 0; j <= 100; j++) {
			HtmlTable valid = page.getFirstByXPath("//table[@class='summary-sub']");
			if (valid != null) {
				HtmlDivision div = page.getFirstByXPath("//div[@class='flight-summary-box']");
				Document doc = Jsoup.parse(div.asXml());
				Elements boxes = doc.select("div#flight-summary-box .singleFlightBox");
				List<FlightInfo> fiList = new ArrayList<FlightInfo>();
				for (int i = 0; i < boxes.size(); i++) {
					FlightInfo flightInfo1 = new FlightInfo();
					Element tb = boxes.get(i);
					flightInfo1.flight_name = tb.select(".flight-name").get(0).text();
					log.info("flightInfo1.flight_name("+i+")===>"+flightInfo1.flight_name);
					Elements tds = tb.select("table td");
					Element td0 = tds.get(0);
					flightInfo1.qf_city = td0.select("span.flight-city").get(0).ownText();// 起飞城市
					flightInfo1.qf_time = td0.select("span.marginLeft").text();// 起飞时间flight-date
					flightInfo1.qf_date = td0.select("span.flight-date").text();// 起飞时间
					Element td1 = tds.get(1);
					flightInfo1.hbh = td1.select("span").text();
					Element td2 = tds.get(2);
					flightInfo1.dd_city = td2.select("span.flight-city").get(0).ownText();// 到达城市
					flightInfo1.dd_time = td2.select("span.marginLeft").text();// 到达时间
					flightInfo1.dd_date = td2.select("span.flight-date").text();// 到达时间
					Element td3 = tds.get(3);
					flightInfo1.cx = td3.select("span").text();
					fiList.add(flightInfo1);
				}
				// 概述完成
				FlightInfo flightInfo = new FlightInfo();
				Elements subTbs = doc.select("div#summary-sub-box table tr");
				for (int k = 1; k < subTbs.size(); k++) {
					Element tr = subTbs.get(k);
					flightInfo.infos[k - 1].lk = tr.select("td").get(0).text();
					flightInfo.infos[k - 1].pj = tr.select("td").get(1).text();
					flightInfo.infos[k - 1].ryf = tr.select("td").get(2).text();
					flightInfo.infos[k - 1].jcs = tr.select("td").get(3).text();
					flightInfo.infos[k - 1].bxf = tr.select("td").get(4).text();
//					log.info(flightInfo.infos);
				}
				flightInfo.total = doc.select("div#price-total span").text();
				
				//常用旅客
				map.put("cpDiv", 0);
				Elements commonPassengerListDivs = doc.select("div#common-passenger-list");
				if(commonPassengerListDivs.size() != 0 ) {
					Element commonPassengerListDiv = commonPassengerListDivs.get(0);
					List<CommonPassenger> cpList = new ArrayList<CommonPassenger>();
					Elements as = commonPassengerListDiv.select("a");
					for (int i = 0; i < as.size(); i++) {
						CommonPassenger commonPassenger = new CommonPassenger();
						String id = as.get(i).attr("id");
						String name = as.get(i).text();
						String aclass = as.get(i).attr("class");
						if(aclass.contains("used")) {
							commonPassenger.setChecked("checked");
						}
						log.info("id====>"+id+",name===>"+name);
						commonPassenger.setId(id);
						commonPassenger.setName(name);
						cpList.add(commonPassenger);
					}
					map.put("cpDiv", 1);
					map.put("cpList", cpList);
				}
				
				List<FlightPassenger> fpList = new ArrayList<FlightPassenger>();
				HtmlElement ulList = (HtmlElement) page.getElementById("passenger-list");
				Document doc1 = Jsoup.parse(ulList.asXml());
				Elements lis = doc1.select("li");
				for (int k = 0; k < lis.size(); k++) {
					FlightPassenger flightPassenger = new FlightPassenger();
					Element li = lis.get(k);
//					log.info(li.toString());
					flightPassenger.pType = li.attr("data-type");
//					log.info("flightPassenger.pType==>" + flightPassenger.pType);
					flightPassenger.name = li.select("input[name=psgName]").first().val();
//					log.info("name====>" + flightPassenger.name);
					flightPassenger.pIdType = li.select("div.select-trigger").get(1).text();
//					log.info("flightPassenger.pIdType==>" + flightPassenger.pIdType);
					flightPassenger.idNO = li.select("input[name=pIdCard]").first().val();
//					log.info("idNo====>" + flightPassenger.idNO);
					
					if (li.select("input[name=pBirthday]").size() != 0) {
						flightPassenger.birthday = li.select("input[name=pBirthday]").first().val();
//						log.info("出生日期==>" + flightPassenger.birthday);
					}
					
					if (li.select("div.psgs-carryByName").size() != 0) {
						flightPassenger.takeName = li.select("div.psgs-carryByName").first().html();
//						log.info("婴儿携带者===>" + flightPassenger.takeName);
					}
					flightPassenger.liId = li.attr("id");
					log.info("flightPassenger.liId==>" + flightPassenger.liId);
					
					flightPassenger.ir0Id = li.select("input.check-box-icon").get(0).attr("id");
					int size = li.select("input.check-box-icon").size();// 保险个数
					log.info("保险个数====>" + size);
					log.info("flightPassenger.ir0Id==>" + flightPassenger.ir0Id);
					
					HtmlInput zhx = (HtmlInput) page.getBody().getElementsByAttribute("input", "data-value", "a")
							.get(k);
					flightPassenger.ir0Check = zhx.isChecked();
					log.info("综合险check====>" + flightPassenger.ir0Check);
					
					flightPassenger.ir0Money = li.select("span.yellow-text").get(0).text();
					log.info("综合险金额===>" + flightPassenger.ir0Money);
					
					if (size == 2) {
						flightPassenger.ir1Id = li.select("input.check-box-icon").get(1).attr("id");
						log.info("flightPassenger.ir1Id==>" + flightPassenger.ir1Id);
						
						HtmlInput tpx = (HtmlInput) page.getBody().getElementsByAttribute("input", "data-value", "b")
								.get(k);
						flightPassenger.ir1Check = tpx.isChecked();
						log.info("退票险check====>" + flightPassenger.ir1Check);
						
						flightPassenger.ir1Money = li.select("span.yellow-text").get(1).text();
						log.info("退票险金额==>" + flightPassenger.ir1Money);
					}
					
					fpList.add(flightPassenger);
				}
				
				HtmlInput contact_nameInput = (HtmlInput) page.getElementById("contact_name");
				String contact_name = contact_nameInput.getAttribute("value");
				map.put("contact_name", contact_name);
				log.info("contact_name==>" + contact_name);
//				HtmlInput contact_moblieInput = (HtmlInput) page.getElementById("contact-moblie");
//				String contact_moblie = contact_moblieInput.getAttribute("mobile");
//				map.put("contact_moblie", contact_moblie);
//				log.info("contact_moblie==>" + contact_moblie);
//				HtmlInput emailInput = (HtmlInput) page.getElementById("email");
//				String email = emailInput.getAttribute("email");
//				map.put("email", email);
//				log.info("email==>" + email);
				
				passengerInformationPage.setLS(CS.SUCCESS);
				log.info(passengerInformationPage.getLS());
				map.put("filist", fiList);
				map.put("flightInfo", flightInfo);
				map.put("fplist", fpList);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				passengerInformationPage.setLS(CS.LOADING);
			}
		}
		passengerInformationPage.setLS(CS.TIMEOUT);
		log.info(passengerInformationPage.getLS());
		return null;
	}

	/**
	 * 变更证件类型
	 */
	public CsairReturnValue changeIDtype(String divId, String optionValue) {
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = passengerInformationPage.getHtmlPage();
		HtmlElement li = page.getFirstByXPath("//li[@id='" + divId + "']");
		passengerInformationPage.setParent(li);
		HtmlDivision select = (HtmlDivision) li.getElementsByAttribute("div", "class", "select-ico").get(1);
		clickHandler(select);
		List<Object> uls = page.getByXPath("//ul[@class='option-group']");
		String optionDataValue = null;
		for (Iterator<Object> iterator = uls.iterator(); iterator.hasNext();) {
			HtmlElement ul = (HtmlElement) iterator.next();
			String n = ul.getAttribute("name1");
			if (n.equals(divId)) {
				String style = ul.getAttribute("style");
				String newStyle = style.replace("none", "block");
				ul.setAttribute("style", newStyle);
			}
			if (ul.getAttribute("style").contains("block")) {
				passengerInformationPage.setParent(ul);
				DomNodeList<DomNode> options = ul.getChildNodes();
//				HtmlElement pli = (HtmlElement) options.get(Integer.valueOf(optionValue));
//				clickHandler(pli);
				for (int i = 0; i < options.size(); i++) {
					 DomNode ho = options.get(i);
					 if(ho != null && ho instanceof HtmlListItem){
						 HtmlListItem ho1 =  (HtmlListItem) ho;
						 optionDataValue =ho1.getAttribute("data-value");
							log.info("optionDataValue======>"+optionDataValue);
							if(optionValue.equals(optionDataValue)){
								clickHandler(ho1);
								break;
							}
					 }
				}
				ul.setAttribute("name1", divId);
				String style = ul.getAttribute("style");
				String newStyle = style.replace("block", "none");
				ul.setAttribute("style", newStyle);
				break;
			}
		}
//		HtmlDivision alertBox = (HtmlDivision) page.getElementById("alert_box");// 弹框
//		String alertBoxClass = alertBox.getAttribute("class");// 取弹框class属性
//		HtmlButton popupWindowButton = (HtmlButton) page.getBody()
//				.getElementsByAttribute("button", "otype", "popupWindow").get(0);// 弹框中"继续"按钮
//		HtmlElement alertDiv = page.getBody().getElementsByAttribute("div", "class", "right confirm-info").get(0);// 弹框中内容提示
//		if (!alertBoxClass.contains("hide")) {
//			returnValue.setState(CS.FAIL);
//			returnValue.setMessage(alertDiv.asText());
//			clickHandler(popupWindowButton);
//			return returnValue;
//		}
		returnValue.setState(CS.SUCCESS);
		return returnValue;
	}
	
	
	/**--------------------------------------------------------------------------------**/
	
	
	/**
	 * 提交旅客信息
	 */
	@Override
	public CsairReturnValue passengerInformation(List<Passenger> list, String contact_name, String contact_moblie,
			String e_mail, String status) {
		CsairReturnValue returnValue = new CsairReturnValue();
		Map<String, Object> map = new HashMap<String, Object>();
		
		log.info("点击‘下一步’，即提交旅客信息");
		long t1 = System.currentTimeMillis();
		map.put("t1", t1);
		HtmlPage page = passengerInformationPage.getHtmlPage();
		

		// 旅客列表(这里传入应该是集合 填写应该是循环)
		HtmlDivision div = page.getFirstByXPath("//div[@id='passenger-block']");
		passengerInformationPage.setParent(div);

		for (int i = 0; i < list.size(); i++) {
			Passenger p = list.get(i);
			String pType = p.getpType();
			if (pType.equals("0")) {
				log.info("类型:成人");
				HtmlInput psgNameInput = (HtmlInput) div.getByXPath("//input[@name='psgName']").get(i);
				psgNameInput.setValueAttribute(p.getPsgName());
				psgNameInput.blur();

				HtmlInput pIdCardInput = (HtmlInput) div.getByXPath("//input[@name='pIdCard']").get(i);
				pIdCardInput.setValueAttribute(p.getpIdCard());
				pIdCardInput.blur();
			}
			if (pType.equals("1")) {
				log.info("类型:儿童");
				HtmlInput psgNameInput = (HtmlInput) div.getByXPath("//input[@name='psgName']").get(i);
				psgNameInput.setValueAttribute(p.getPsgName());
				psgNameInput.blur();

				HtmlInput pIdCardInput = (HtmlInput) div.getByXPath("//input[@name='pIdCard']").get(i);
				pIdCardInput.setValueAttribute(p.getpIdCard());
				pIdCardInput.blur();

				HtmlInput pBirthdayInput = (HtmlInput) div.getByXPath("//input[@name='pBirthday']").get(i - 1);
				pBirthdayInput.setValueAttribute(p.getpBirthday());
				pBirthdayInput.blur();
			}
			if (pType.equals("2")) {
				log.info("类型:婴儿");
				HtmlInput psgNameInput = (HtmlInput) div.getByXPath("//input[@name='psgName']").get(i);
				psgNameInput.setValueAttribute(p.getPsgName());
				psgNameInput.blur();

				HtmlInput pBirthdayInput = (HtmlInput) div.getByXPath("//input[@name='pBirthday']").get(i - 1);
				pBirthdayInput.setValueAttribute(p.getpBirthday());
//				log.info(pBirthdayInput.asXml());
				pBirthdayInput.blur();

				HtmlDivision carryByName = (HtmlDivision) div
						.getByXPath("//div[@class='select-trigger psgs-carryByName']").get(i - 1);
				carryByName.setTextContent(p.getCarryByName());
				carryByName.blur();
				log.info("carryByName====>" + carryByName);
			}
		}

		// 联系人信息
		HtmlForm form = page.getFirstByXPath("//form[@id='contactor']");
		passengerInformationPage.setParent(form);

		HtmlInput contact_nameInput = form.getFirstByXPath("//input[@id='contact_name']");
		contact_nameInput.setValueAttribute(contact_name);

		HtmlInput contact_moblieInput = form.getFirstByXPath("//input[@id='contact-moblie']");
		contact_moblieInput.setValueAttribute(contact_moblie);

		HtmlInput e_mailInput = form.getFirstByXPath("//input[@id='email']");
		e_mailInput.setValueAttribute(e_mail);
		e_mailInput.setAttribute("email", e_mail);
		e_mailInput.setAttribute("data-html", e_mail);
		HtmlDivision checkDiv = (HtmlDivision) page.getElementById("protocol-checkbox");// 阅读条款
		String checkInputClass = checkDiv.getAttribute("class");
		if (!checkInputClass.contains("checked")) {
			clickHandler(checkDiv);
			log.info("勾选须知!!!!!");
		}
		//点击“下一步”
		try {
			Thread.sleep(2000);
		} catch (InterruptedException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		clickHandler(page.getElementById("submitForm"));
		log.info("点击下一步");
		long t2 = System.currentTimeMillis();
		map.put("t2", t2);
		returnValue.setMap(map);
		log.info("无障碍填写页面信息用时:"+(t2 - t1)/1000.0+"s");
		HtmlDivision alertBox = (HtmlDivision) page.getElementById("alert_box");// 弹框
		String alertBoxClass = alertBox.getAttribute("class");// 取弹框class属性
		System.out.println("alertBoxClass======>"+alertBoxClass);
		HtmlButton popupWindowButton = (HtmlButton) page.getBody()
				.getElementsByAttribute("button", "otype", "popupWindow").get(0);// 弹框中"继续"按钮
		HtmlElement alertDiv = page.getBody().getElementsByAttribute("div", "class", "right confirm-info").get(0);// 弹框中内容提示
		if (!alertBoxClass.contains("hide")) {
			log.info("有alertBox");
			returnValue.setState(CS.FAIL);
			returnValue.setMessage(alertDiv.asText());
			clickHandler(popupWindowButton);
			return returnValue;
		}
		for (int i = 0; i < 15; i++) {
			log.info("进入循环！");
			if (scl.URLpay != null) {
				log.info("发现生成订单文件！");
				returnValue.setState(CS.SUCCESS);
				log.info("scl.URLpay==>"+scl.URLpay);
				scl.URLpay = null;
				log.info("清空URLpay,scl.URLpay==>"+scl.URLpay);
				return returnValue;
			}
			synchronized (page) {
				try {
					page.wait(1000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("等待订单产生.....");
			}
		}
		returnValue.setState(CS.SUCCESS);
		return returnValue;
	}

	/**
	 * 加载订单支付页面
	 */
	@Override
	public Map<String, Object> goPayPage(String orderNo,HttpSession session ) {
		scl.couponRemarkLoad = null;
		log.info("orderNo===>"+orderNo);
		Map<String, Object> map = new HashMap<String, Object>();
		if (orderNo == null || orderNo.equals("")) {
			log.error("订单号为空，中断跳转到支付页面");
			return null;
		}
		String URLOrderPay = Csair.URLpay + "?orderNo=" + orderNo + "&inter=1";
		long t1 = System.currentTimeMillis();
		for (int i = 0; i <= timeoutmax; i++) {
			orderPaymentPage = webClient.getCsairHtmlPage(URLOrderPay, "URLOrderPay", false);
			// log.info("------------------------------------------------------------------");
			// log.info("orderPaymentPage==>"+orderPaymentPage.getHtmlPage());
			// log.info("orderPaymentPage==>"+orderPaymentPage.getHtmlPage().asXml());
			// log.info("------------------------------------------------------------------");
			if (orderPaymentPage.isNull() == false) {
				break;
			}
		}
		HtmlPage page = orderPaymentPage.getHtmlPage();
		List<HtmlElement> imgBoxDivs = page.getBody().getElementsByAttribute("div", "class", "imgBox");
		for (int i = 0; i <= timeoutmax; i++) {
			HtmlDivision dzqbAjaxDiv = (HtmlDivision) page.getElementById("dzqbAjaxDiv");
			System.out.println("dzqbAjaxDiv==>"+dzqbAjaxDiv);
			if (page.getElementById("payMoney") != null && imgBoxDivs.size()!=0 && dzqbAjaxDiv != null) {
				long t2 = System.currentTimeMillis();
				log.info("================================================================");
				double nanhangTime3 = (t2-t1)/1000.0;
				map.put("nanhangTime3", nanhangTime3);
				orderPaymentPage.setLS(CS.SUCCESS);
				log.info(orderPaymentPage.getLS() + "支付页面加载成功!!!");
				FlightPayInfo fpi = new FlightPayInfo();
				FlightPayInfo fpi2 = new FlightPayInfo();
				FlightPayInfo fpi3 = new FlightPayInfo();
				FlightPayInfo fpi4 = new FlightPayInfo();
				List<Passenger> passengers = new ArrayList<Passenger>();
				HtmlDivision div = page.getFirstByXPath("//div[@class='order-summary']");
				Document doc = Jsoup.parse(div.asXml());
				String payOrderNo = doc.select("span.order-no  b").get(0).ownText();
				fpi.setPayOrderNo(payOrderNo);

				Elements flightInfo = doc.select("table#flight-info");
				Elements flightInfotr = flightInfo.select("tr");
				int trsize = flightInfotr.size();
				if(trsize == 1) {
					String flightType = flightInfo.select("td.flight-type span").get(0).text();
					fpi.setFlightType(flightType);
					String flightCity1 = flightInfo.select("div.tripPlace").get(0).ownText();
					fpi.setFlightCity1(flightCity1);
					String flightCity2 = flightInfo.select("div.tripPlace").get(1).ownText();
					fpi.setFlightCity2(flightCity2);
					String flightDate = flightInfo.select("div.tripDate").get(0).ownText();
					fpi.setFlightDate(flightDate);
					String sendTime = flightInfo.select("div.tripTime").get(0).ownText();
					fpi.setSendTime(sendTime);
					String arriveTime = flightInfo.select("div.tripTime").get(1).ownText();
					fpi.setArriveTime(arriveTime);
					String flightCabin = flightInfo.select("td.ticketNum span").get(0).ownText();
					fpi.setFlightCabin(flightCabin);
					String flightCabinLevel = flightInfo.select("td.flightSeatType span").get(0).ownText();
					fpi.setFlightCabinLevel(flightCabinLevel);
				}
				if(trsize == 2) {
					String flightType = flightInfo.select("td.flight-type span").get(0).text();
					fpi.setFlightType(flightType);
					String flightCity11 = flightInfo.select("div.tripPlace").get(0).ownText();
					fpi.setFlightCity1(flightCity11);
					String flightCity12 = flightInfo.select("div.tripPlace").get(1).ownText();
					fpi.setFlightCity2(flightCity12);
					String flightDate = flightInfo.select("div.tripDate").get(0).ownText();
					fpi.setFlightDate(flightDate);
					String sendTime = flightInfo.select("div.tripTime").get(0).ownText();
					fpi.setSendTime(sendTime);
					String arriveTime = flightInfo.select("div.tripTime").get(1).ownText();
					fpi.setArriveTime(arriveTime);
					String flightCabin = flightInfo.select("td.ticketNum span").get(0).ownText();
					fpi.setFlightCabin(flightCabin);
					String flightCabinLevel = flightInfo.select("td.flightSeatType span").get(0).ownText();
					fpi.setFlightCabinLevel(flightCabinLevel);
					
					String flightType2 = flightInfo.select("td.flight-type span").get(1).text();
					fpi2.setFlightType(flightType2);
					String flightCity21 = flightInfo.select("div.tripPlace").get(2).ownText();
					fpi2.setFlightCity1(flightCity21);
					String flightCity22 = flightInfo.select("div.tripPlace").get(3).ownText();
					fpi2.setFlightCity2(flightCity22);
					String flightDate2 = flightInfo.select("div.tripDate").get(2).ownText();
					fpi2.setFlightDate(flightDate2);
					String sendTime2 = flightInfo.select("div.tripTime").get(2).ownText();
					fpi2.setSendTime(sendTime2);
					log.info("sendTime2====>"+sendTime2);
					String arriveTime2 = flightInfo.select("div.tripTime").get(3).ownText();
					fpi2.setArriveTime(arriveTime2);
					String flightCabin2 = flightInfo.select("td.ticketNum span").get(1).ownText();
					fpi2.setFlightCabin(flightCabin2);
					String flightCabinLevel2 = flightInfo.select("td.flightSeatType span").get(1).ownText();
					fpi2.setFlightCabinLevel(flightCabinLevel2);
				}
				if(trsize == 3) {
					String flightType = flightInfo.select("td.flight-type span").get(0).text();
					fpi.setFlightType(flightType);
					String flightCity11 = flightInfo.select("div.tripPlace").get(0).ownText();
					fpi.setFlightCity1(flightCity11);
					String flightCity12 = flightInfo.select("div.tripPlace").get(1).ownText();
					fpi.setFlightCity2(flightCity12);
					String flightDate = flightInfo.select("div.tripDate").get(0).ownText();
					fpi.setFlightDate(flightDate);
					String sendTime = flightInfo.select("div.tripTime").get(0).ownText();
					fpi.setSendTime(sendTime);
					String arriveTime = flightInfo.select("div.tripTime").get(1).ownText();
					fpi.setArriveTime(arriveTime);
					String flightCabin = flightInfo.select("td.ticketNum span").get(0).ownText();
					fpi.setFlightCabin(flightCabin);
					String flightCabinLevel = flightInfo.select("td.flightSeatType span").get(0).ownText();
					fpi.setFlightCabinLevel(flightCabinLevel);
					
					String flightType2 = flightInfo.select("td.flight-type span").get(1).text();
					fpi2.setFlightType(flightType2);
					String flightCity21 = flightInfo.select("div.tripPlace").get(2).ownText();
					fpi2.setFlightCity1(flightCity21);
					String flightCity22 = flightInfo.select("div.tripPlace").get(3).ownText();
					fpi2.setFlightCity2(flightCity22);
					String flightDate2 = flightInfo.select("div.tripDate").get(2).ownText();
					fpi2.setFlightDate(flightDate2);
					String sendTime2 = flightInfo.select("div.tripTime").get(2).ownText();
					fpi2.setSendTime(sendTime2);
					log.info("sendTime2====>"+sendTime2);
					String arriveTime2 = flightInfo.select("div.tripTime").get(3).ownText();
					fpi2.setArriveTime(arriveTime2);
					String flightCabin2 = flightInfo.select("td.ticketNum span").get(1).ownText();
					fpi2.setFlightCabin(flightCabin2);
					String flightCabinLevel2 = flightInfo.select("td.flightSeatType span").get(1).ownText();
					fpi2.setFlightCabinLevel(flightCabinLevel2);
					
					String flightType3 = flightInfo.select("td.flight-type span").get(2).text();
					fpi3.setFlightType(flightType3);
					String flightCity31 = flightInfo.select("div.tripPlace").get(4).ownText();
					fpi3.setFlightCity1(flightCity31);
					String flightCity32 = flightInfo.select("div.tripPlace").get(5).ownText();
					fpi3.setFlightCity2(flightCity32);
					String flightDate3 = flightInfo.select("div.tripDate").get(4).ownText();
					fpi3.setFlightDate(flightDate3);
					String sendTime3 = flightInfo.select("div.tripTime").get(4).ownText();
					fpi3.setSendTime(sendTime3);
					log.info("sendTime3====>"+sendTime3);
					String arriveTime3 = flightInfo.select("div.tripTime").get(5).ownText();
					fpi3.setArriveTime(arriveTime3);
					String flightCabin3 = flightInfo.select("td.ticketNum span").get(2).ownText();
					fpi3.setFlightCabin(flightCabin3);
					String flightCabinLevel3 = flightInfo.select("td.flightSeatType span").get(2).ownText();
					fpi3.setFlightCabinLevel(flightCabinLevel3);
				}
				if(trsize == 4) {
					String flightType = flightInfo.select("td.flight-type span").get(0).text();
					fpi.setFlightType(flightType);
					String flightCity11 = flightInfo.select("div.tripPlace").get(0).ownText();
					fpi.setFlightCity1(flightCity11);
					String flightCity12 = flightInfo.select("div.tripPlace").get(1).ownText();
					fpi.setFlightCity2(flightCity12);
					String flightDate = flightInfo.select("div.tripDate").get(0).ownText();
					fpi.setFlightDate(flightDate);
					String sendTime = flightInfo.select("div.tripTime").get(0).ownText();
					fpi.setSendTime(sendTime);
					String arriveTime = flightInfo.select("div.tripTime").get(1).ownText();
					fpi.setArriveTime(arriveTime);
					String flightCabin = flightInfo.select("td.ticketNum span").get(0).ownText();
					fpi.setFlightCabin(flightCabin);
					String flightCabinLevel = flightInfo.select("td.flightSeatType span").get(0).ownText();
					fpi.setFlightCabinLevel(flightCabinLevel);
					
					String flightType2 = flightInfo.select("td.flight-type span").get(1).text();
					fpi2.setFlightType(flightType2);
					String flightCity21 = flightInfo.select("div.tripPlace").get(2).ownText();
					fpi2.setFlightCity1(flightCity21);
					String flightCity22 = flightInfo.select("div.tripPlace").get(3).ownText();
					fpi2.setFlightCity2(flightCity22);
					String flightDate2 = flightInfo.select("div.tripDate").get(2).ownText();
					fpi2.setFlightDate(flightDate2);
					String sendTime2 = flightInfo.select("div.tripTime").get(2).ownText();
					fpi2.setSendTime(sendTime2);
					log.info("sendTime2====>"+sendTime2);
					String arriveTime2 = flightInfo.select("div.tripTime").get(3).ownText();
					fpi2.setArriveTime(arriveTime2);
					String flightCabin2 = flightInfo.select("td.ticketNum span").get(1).ownText();
					fpi2.setFlightCabin(flightCabin2);
					String flightCabinLevel2 = flightInfo.select("td.flightSeatType span").get(1).ownText();
					fpi2.setFlightCabinLevel(flightCabinLevel2);
					
					String flightType3 = flightInfo.select("td.flight-type span").get(2).text();
					fpi3.setFlightType(flightType3);
					String flightCity31 = flightInfo.select("div.tripPlace").get(4).ownText();
					fpi3.setFlightCity1(flightCity31);
					String flightCity32 = flightInfo.select("div.tripPlace").get(5).ownText();
					fpi3.setFlightCity2(flightCity32);
					String flightDate3 = flightInfo.select("div.tripDate").get(4).ownText();
					fpi3.setFlightDate(flightDate3);
					String sendTime3 = flightInfo.select("div.tripTime").get(4).ownText();
					fpi3.setSendTime(sendTime3);
					log.info("sendTime3====>"+sendTime3);
					String arriveTime3 = flightInfo.select("div.tripTime").get(5).ownText();
					fpi3.setArriveTime(arriveTime3);
					String flightCabin3 = flightInfo.select("td.ticketNum span").get(2).ownText();
					fpi3.setFlightCabin(flightCabin3);
					String flightCabinLevel3 = flightInfo.select("td.flightSeatType span").get(2).ownText();
					fpi3.setFlightCabinLevel(flightCabinLevel3);
					
					String flightType4 = flightInfo.select("td.flight-type span").get(3).text();
					fpi4.setFlightType(flightType4);
					String flightCity41 = flightInfo.select("div.tripPlace").get(6).ownText();
					fpi4.setFlightCity1(flightCity41);
					String flightCity42 = flightInfo.select("div.tripPlace").get(7).ownText();
					fpi4.setFlightCity2(flightCity42);
					String flightDate4 = flightInfo.select("div.tripDate").get(6).ownText();
					fpi4.setFlightDate(flightDate4);
					String sendTime4 = flightInfo.select("div.tripTime").get(6).ownText();
					fpi4.setSendTime(sendTime4);
					log.info("sendTime4====>"+sendTime4);
					String arriveTime4 = flightInfo.select("div.tripTime").get(7).ownText();
					fpi4.setArriveTime(arriveTime4);
					String flightCabin4 = flightInfo.select("td.ticketNum span").get(3).ownText();
					fpi4.setFlightCabin(flightCabin4);
					String flightCabinLevel4 = flightInfo.select("td.flightSeatType span").get(3).ownText();
					fpi4.setFlightCabinLevel(flightCabinLevel4);
				}
				

				Element tbody = doc.select("table#psg-info tbody").first();
				Elements psgInfo = doc.select("table#psg-info tr");
				log.info("乘客信息条数psgInfo.size()====>" + psgInfo.size());
				for (int j = 0; j < psgInfo.size(); j++) {
					Passenger passenger = new Passenger();
					String psgName = tbody.select("tr:eq(" + j + ") td.info-name  b").first().text();
					passenger.setPsgName(psgName);
//					log.info(j + "==>psgName:" + psgName);
					String pType = tbody.select("tr:eq(" + j + ") td.info-name  span").first().text();
					passenger.setpType(pType);
//					log.info(j + "==>pType:" + pType);
					// String pIdCard = psgInfo.select("b:eq(1)").get(j).ownText();
					String pIdCard = tbody.select("tr:eq(" + j + ") td:eq(3)").text();
					passenger.setpIdCard(pIdCard);
//					log.info(j + "==>pIdCard:" + pIdCard);
					String pIdType = tbody.select("tr:eq(" + j + ") td:eq(2)").text();
					passenger.setpIdType(pIdType);
//					log.info(j + "==>pIdType:" + pIdType);
					String pBirthday = tbody.select("tr:eq(" + j + ")  td:eq(5)").text();
					passenger.setpBirthday(pBirthday);
//					log.info(j + "==>pBirthday:" + pBirthday);

					passengers.add(passenger);
					fpi.setPassengers(passengers);
				}

				Elements contactInfo = doc.select("table#contact-info");
				String lianxiren = contactInfo.select("b#lianxiren").get(0).ownText();
				fpi.setLianxiren(lianxiren);
				String lianxirenPhone = contactInfo.select("span#lianxirenPhone").get(0).text();
				fpi.setLianxirenPhone(lianxirenPhone);
				String lianxirenEmail = contactInfo.select("span#lianxirenEmail").get(0).text();
				fpi.setLianxirenEmail(lianxirenEmail);

				Elements priceTotal = doc.select("td.order-price-total");
				String price = priceTotal.select("span#payMoney").get(0).ownText();
				fpi.setPrice(price);
				map.put("fpi", fpi);
				map.put("fpi2", fpi2);
				map.put("fpi3", fpi3);
				map.put("fpi4", fpi4);
		/*****************************余额支付加载*********************************/
				String userType = session.getAttribute(Csair.USERTYPE).toString();
				log.info("userType===>"+userType);
				if(userType.toString().equals("1")) {
					HtmlSpan voucher_balance_TotalSpan = null;
					for (int j = 0; j < 25; j++) {
						if(scl.couponRemarkLoad != null) {
							voucher_balance_TotalSpan = (HtmlSpan) page.getElementById("voucher_balance_Total");
							System.out.println("voucher_balance_TotalSpan==>"+voucher_balance_TotalSpan);
							break;
						}
						synchronized (page) {
							try {
								page.wait(200);
								log.info("loading couponRemarkLoad......");
							} catch (InterruptedException e) {
								// TODO Auto-generated catch block
								e.printStackTrace();
							}
						}
					}
				
					
				
					if(voucher_balance_TotalSpan == null) {
						map.put("yueMark", "wkt");//未开通余额支付
					}else {
						HtmlInput myBalanceInput = (HtmlInput) page.getElementById("myBalance");
						String myBalanceInputStyle = myBalanceInput.getAttribute("style");
						System.out.println("myBalanceInputStyle==>"+myBalanceInputStyle);
						if(myBalanceInputStyle.contains("none")) {
							System.out.println("contains none");
//							HtmlSpan voucher_balance_TotalSpan = (HtmlSpan) page.getElementById("voucher_balance_Total");
							String yuE = voucher_balance_TotalSpan.asText();
							System.out.println("yuE====>"+yuE);
							map.put("yuE", yuE);
							map.put("yueMark", "yebz");//余额不足
						}else {
							System.out.println("it's not contains none");
//							HtmlSpan voucher_balance_TotalSpan = (HtmlSpan) page.getElementById("voucher_balance_Total");
							String yuE = voucher_balance_TotalSpan.asText();
							map.put("yuE", yuE);
							map.put("yueMark", "kzf");//可支付
						}
					}
					
				}
				
		/*******************************获取微信二维码*****************************/
				
				DomNodeList<DomElement> imgs = page.getElementsByTagName("img");
				for (int k = 0; k < imgs.size(); k++) {
					DomElement img = imgs.get(i);
					String imgsSrc = img.getAttribute("src");
					if(imgsSrc.contains("WXPM")) {
						System.out.println(img.asXml());
//						clickHandler(img);
						StringBuilder js = new StringBuilder();
						js.append("$(\"img[src='/upp_payment/pay/common/images/bank/WXPM.GIF']\").click();");  
				        page.executeJavaScript(js.toString());
						break;
					}
				}
				
				for (int j = 0; j < timeoutmax; j++) {
					DomNodeList<HtmlElement> weixinPayImgs = imgBoxDivs.get(0).getElementsByTagName("img");
					if(weixinPayImgs.size()!=0) {
						String imgSrc = "https://upp.csair.com"+weixinPayImgs.get(0).getAttribute("src");
						System.out.println("imgSrc====>"+imgSrc);
						map.put("imgSrc", imgSrc);
						break;
					}
					synchronized (page) {
						try {
							page.wait(500);
							log.info("加载微信二维码......");
						} catch (InterruptedException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
					}
				}
		/********************************************************************************/

				long t3 = System.currentTimeMillis();
				double chuliTime3 = (t3-t2)/1000.0;
				map.put("chuliTime3", chuliTime3);
				log.info("无障碍页面加载成功，无障碍处理用时"+chuliTime3+"s");
				log.info("支付页面共用时"+(t3-t1)/1000.0+"s");
				
				return map;
			}
			if (page.getElementById("pay-status") != null) {
				FlightPayInfo fpi = new FlightPayInfo();
				fpi.setPayOrderNo(null);
				map.put("fpi", fpi);
				return map;
			}

			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {

					e.printStackTrace();
					orderPaymentPage.setLS(CS.FAIL);
					log.info(orderPaymentPage.getLS());
				}
				orderPaymentPage.setLS(CS.LOADING);
				log.info(orderPaymentPage.getLS());
			}
		}
		long t2 = System.currentTimeMillis();
		log.info("================================================================");
		double nanhangTime3 = (t2-t1)/1000.0;
		map.put("nanhangTime3", nanhangTime3);
		long t3 = System.currentTimeMillis();
		double chuliTime3 = (t3-t2)/1000.0;
		map.put("chuliTime3", chuliTime3);
		log.info("加载失败，无障碍处理用时"+chuliTime3+"s");
		log.info("支付页面共用时"+(t3-t1)/1000.0+"s");

		orderPaymentPage.setLS(CS.TIMEOUT);
		log.info(orderPaymentPage.getLS());
		return null;
	}

	/**
	 * 订单支付页面借记卡发送验证码
	 */
	@Override
	public CsairReturnValue orderPageYzm(String accountNo, String buyerName, String idCard, String mobile) {
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = orderPaymentPage.getHtmlPage();
		List<HtmlElement> hes = page.getBody().getElementsByAttribute("div","class", "pay-way-name");
		HtmlElement he = null;
		for (int i = 0; i < hes.size(); i++) {
			he = hes.get(i);
			if(he.asText().contains("快捷支付")) {
				clickHandler(he);
			}
		}
		
		HtmlUnorderedList ul = (HtmlUnorderedList) page.getElementById("Credit_Card_Payment ");
		orderPaymentPage.setParent(ul);

		HtmlElement borrowCardRadio = ul.getFirstByXPath("//input[@id='borrowCard']");
		clickHandler(borrowCardRadio);

		HtmlInput accountNoInput = ul.getFirstByXPath("//input[@id='ACCOUNTNO']");
		accountNoInput.setValueAttribute(accountNo);

		HtmlInput buyerNameInput = ul.getFirstByXPath("//input[@id='BUYERNAME']");
		buyerNameInput.setValueAttribute(buyerName);

		HtmlInput idCardInput = ul.getFirstByXPath("//input[@id='IDCARD']");
		idCardInput.setValueAttribute(idCard);

		HtmlInput mobileInput = ul.getFirstByXPath("//input[@id='MOBILE']");
		mobileInput.setValueAttribute(mobile);
		
		HtmlElement codeButton = ul.getFirstByXPath("//input[@id='buttonForCode']");
		codeButton.removeAttribute("disabled");
		clickHandler(codeButton);
		for (int i = 0; i <= timeoutmax; i++) {
			if (!"".equals(page.getElementById("phoneTips").asText().trim())) {
				log.info("----------加载验证信息------------------");
				String codeMsg = page.getElementById("phoneTips").asText().trim();
				returnValue.setMessage(codeMsg);
				return returnValue;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {

					e.printStackTrace();
				}
				log.info("----------加载验证信息ing------------------");
			}
		}
		returnValue.setMessage("验证信息加载失败!!");
		log.info("验证信息加载失败!!");
		return returnValue;
	}

	/**
	 * 订单支付页面信用卡发送验证码
	 */
	@Override
	public CsairReturnValue xykPayOrderYzm(String accountNo,String EXPIREMONTH, String EXPIREYEAR, String cvv,String buyerName, String idCard, String mobile) {
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = orderPaymentPage.getHtmlPage();
		
		List<HtmlElement> hes = page.getBody().getElementsByAttribute("div","class", "pay-way-name");
		HtmlElement he = null;
		for (int i = 0; i < hes.size(); i++) {
			he = hes.get(i);
			if(he.asText().contains("快捷支付")) {
				clickHandler(he);
			}
		}
		HtmlUnorderedList ul = (HtmlUnorderedList) page.getElementById("Credit_Card_Payment ");
		orderPaymentPage.setParent(ul);

		HtmlElement borrowCardRadio = ul.getFirstByXPath("//input[@id='raCredit']");
		clickHandler(borrowCardRadio);

		HtmlInput accountNoInput = ul.getFirstByXPath("//input[@id='ACCOUNTNO']");
		accountNoInput.setValueAttribute(accountNo);
		
		HtmlSelect expiremonthSelect = ul.getFirstByXPath("//select[@id='EXPIREMONTH']");
		HtmlOption expiremonthOption = expiremonthSelect.getOptionByValue(EXPIREMONTH);
		expiremonthOption.setSelected(true);
		
		HtmlSelect expireyearSelect = ul.getFirstByXPath("//select[@id='EXPIREYEAR']");
		HtmlOption expireyearOption = expireyearSelect.getOptionByValue(EXPIREYEAR);
		expireyearOption.setSelected(true);
		
		HtmlInput CVVInput = ul.getFirstByXPath("//input[@id='CVV']");
		CVVInput.setValueAttribute(cvv);

		HtmlInput buyerNameInput = ul.getFirstByXPath("//input[@id='BUYERNAME']");
		buyerNameInput.setValueAttribute(buyerName);

		HtmlInput idCardInput = ul.getFirstByXPath("//input[@id='IDCARD']");
		idCardInput.setValueAttribute(idCard);

		HtmlInput mobileInput = ul.getFirstByXPath("//input[@id='MOBILE']");
		mobileInput.setValueAttribute(mobile);
		
		HtmlInput codeButton = ul.getFirstByXPath("//input[@id='buttonForCode']");
		codeButton.removeAttribute("disabled");
		clickHandler(codeButton);
		
		for (int i = 0; i <= timeoutmax; i++) {
			if (!"".equals(page.getElementById("phoneTips").asText().trim())) {
				log.info("----------加载验证信息------------------");
				String codeMsg = page.getElementById("phoneTips").asText().trim();
				returnValue.setMessage(codeMsg);
				return returnValue;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {

					e.printStackTrace();
				}
				log.info("----------加载验证信息ing------------------");
			}
		}
		returnValue.setMessage("验证信息加载失败!!");
		log.info("验证信息加载失败!!");
		return returnValue;
	}
	
	/**
	 * 借记卡执行支付
	 */
	@Override
	public CsairReturnValue orderPayment(String codeName) {
		scl.URLpayComplete = null;
		scl.URLpayErro = null;
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = orderPaymentPage.getHtmlPage();
		try {
			Thread.sleep(200);
		} catch (InterruptedException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		HtmlDivision div = page.getFirstByXPath("//div[@class='credit1']");
//		log.info("div========>" + div.asXml());
		HtmlInput codeNameInput = (HtmlInput) page.getElementById("CODENAME"); // 验证码
		codeNameInput.setValueAttribute(codeName);

		HtmlInput payButton = page.getElementByName("upp_pay_btn"); // 执行支付按钮
		page = clickHandler(payButton);
		HtmlDivision popboxDiv = (HtmlDivision) page.getElementById("popbox");
		HtmlSpan alertSpan = (HtmlSpan) page.getBody().getElementsByAttribute("span", "class", "info2").get(0);
		HtmlDivision alertDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "infodt").get(0);
		for (int i = 0; i <= timeoutmax; i++) {
			if (!popboxDiv.getAttribute("class").contains("hide")) {
				returnValue.setMessage(alertSpan.asText() + "," + alertDiv.asText());
				log.info("alertDiv.asText()===>" + alertSpan.asText() + "," + alertDiv.asText());
				returnValue.setState(CS.FAIL);
				
				clickHandler(page.getElementById("btnsty1"));
				return returnValue;
			} else if (scl.URLpayComplete != null) {
				returnValue.setMessage("支付成功!");
				returnValue.setState(CS.SUCCESS);
				log.info("完成支付!!");
				return returnValue;
			} else if (scl.URLpayErro != null) {
				returnValue.setMessage("支付失败!");
				returnValue.setCheckmodel(Boolean.TRUE);
				log.info("支付失败!!");
				returnValue.setState(CS.FAIL);
				return returnValue;
			}

			synchronized (page) {
				try {
					page.wait(1000);
				} catch (InterruptedException e) {

					e.printStackTrace();
				}
				log.info("支付信息加载中........");
			}
		}
		returnValue.setMessage("支付失败");
		log.info("支付失败");
		returnValue.setState(CS.FAIL);
		return returnValue;
	}

	/**
	 * 信用卡订单支付
	 */
	@Override
	public CsairReturnValue xykQueryAndPayOrder(String codeName,String expiremonth, String expireyear) {
		scl.URLpayComplete = null;
		scl.URLpayErro = null;
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = orderPaymentPage.getHtmlPage();
		try {
			Thread.sleep(200);
		} catch (InterruptedException e1) {
			e1.printStackTrace();
		}
		HtmlDivision div = page.getFirstByXPath("//div[@class='credit1']");
//		log.info("div========>" + div.asXml());
		HtmlInput codeNameInput = (HtmlInput) page.getElementById("CODENAME"); // 验证码
		codeNameInput.setValueAttribute(codeName);
		
		HtmlSelect expiremonthSelect = (HtmlSelect) page.getElementById("EXPIREMONTH");
		HtmlOption expiremonthOption = expiremonthSelect.getOptionByValue(expiremonth);
		expiremonthOption.setSelected(true);
		expiremonthOption.type(9);
		
		HtmlSelect expireyearSelect = (HtmlSelect) page.getElementById("EXPIREYEAR");
		HtmlOption expireyearOption = expireyearSelect.getOptionByValue(expireyear);
		expireyearOption.setSelected(true);
		expireyearOption.type(9);

		HtmlInput payButton = page.getElementByName("upp_pay_btn"); // 执行支付按钮
		page = clickHandler(payButton);
		HtmlDivision popboxDiv = (HtmlDivision) page.getElementById("popbox");
		HtmlSpan alertSpan = (HtmlSpan) page.getBody().getElementsByAttribute("span", "class", "info2").get(0);
		HtmlDivision alertDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "infodt").get(0);
		for (int i = 0; i <= timeoutmax; i++) {
			if (!popboxDiv.getAttribute("class").contains("hide")) {
				returnValue.setMessage(alertSpan.asText() + "," + alertDiv.asText());
				log.info("alertDiv.asText()===>" + alertSpan.asText() + "," + alertDiv.asText());
				returnValue.setState(CS.FAIL);
				
				clickHandler(page.getElementById("btnsty1"));
				return returnValue;
			} else if (scl.URLpayComplete != null) {
				returnValue.setMessage("支付成功!");
				returnValue.setState(CS.SUCCESS);
				log.info("完成支付!!");
				return returnValue;
			} else if (scl.URLpayErro != null) {
				returnValue.setMessage("支付失败!");
				returnValue.setCheckmodel(Boolean.TRUE);
				log.info("支付失败!!");
				returnValue.setState(CS.FAIL);
				return returnValue;
			}

			synchronized (page) {
				try {
					page.wait(1000);
				} catch (InterruptedException e) {

					e.printStackTrace();
				}
				log.info("支付信息加载中........");
			}
		}
		returnValue.setMessage("支付失败");
		log.info("支付失败");
		returnValue.setState(CS.FAIL);
		return returnValue;

	}
	
	/**
	 * 微信点击已完成支付
	 */
	@Override
	public CsairReturnValue weixinPaymentCompleted() {
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = orderPaymentPage.getHtmlPage();
		HtmlButton succeed_wxbtn = (HtmlButton) page.getElementById("succeed_wxbtn");
		clickHandler(succeed_wxbtn);
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision popboxDiv = (HtmlDivision) page.getElementById("popbox");
			String popboxDivClass = popboxDiv.getAttribute("class");
			if(!popboxDivClass.contains("hide")) {
				HtmlSpan info2Span = (HtmlSpan) page.getBody().getElementsByAttribute("span", "class", "info2").get(0);
				String info2SpanText = info2Span.asText();
				HtmlElement infodtDiv = page.getBody().getElementsByAttribute("div", "class", "infodt").get(0);
				String infodtDivText = infodtDiv.asText();
				returnValue.setMessage(info2SpanText+infodtDivText);
				HtmlAnchor btnsty1 = (HtmlAnchor) page.getElementById("btnsty1");
				clickHandler(btnsty1);
				return returnValue;
			}
			synchronized (page) {
				log.info("等待提示框....");
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		return null;
	}
	
	/**
	 * 余额点击支付
	 */
	@Override
	public CsairReturnValue yuEpay(String zhifupsd ) {
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = orderPaymentPage.getHtmlPage();
		HtmlInput myBalanceInput = (HtmlInput) page.getElementById("myBalance");
		clickHandler(myBalanceInput);
		HtmlInput input_pswInput = (HtmlInput) page.getElementById("input_psw");
		input_pswInput.focus();
		input_pswInput.setValueAttribute(zhifupsd);
		
		HtmlInput payButton = page.getElementByName("upp_pay_btn"); // 执行支付按钮
		page = clickHandler(payButton);
		
		HtmlDivision popboxDiv = (HtmlDivision) page.getElementById("popbox");
		String popboxDivClass = popboxDiv.getAttribute("class");
		System.out.println("popboxDivClass===>"+popboxDivClass);
		HtmlSpan alertSpan = (HtmlSpan) page.getBody().getElementsByAttribute("span", "class", "info2").get(0);
		HtmlDivision alertDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "infodt").get(0);
		for (int i = 0; i <= timeoutmax; i++) {
			System.out.println("popboxDivClass===>"+popboxDivClass);
			if (!popboxDiv.getAttribute("class").contains("hide")) {
				returnValue.setMessage(alertSpan.asText() + "," + alertDiv.asText());
				log.info("alertDiv.asText()===>" + alertSpan.asText() + "," + alertDiv.asText());
				returnValue.setState(CS.FAIL);
				  
				clickHandler(page.getElementById("btnsty1"));
				return returnValue;
			} else if (scl.URLpayComplete != null) {
				returnValue.setMessage("支付成功!");
				returnValue.setState(CS.SUCCESS);
				log.info("完成支付!!");
				return returnValue;
			} else if (scl.URLpayErro != null) {
				returnValue.setMessage("支付失败!");
				returnValue.setCheckmodel(Boolean.TRUE);
				log.info("支付失败!!");
				returnValue.setState(CS.FAIL);
				return returnValue;
			}

			synchronized (page) {
				try {
					page.wait(1000);
				} catch (InterruptedException e) {

					e.printStackTrace();
				}
				log.info("支付信息加载中........");
			}
		}
		returnValue.setMessage("支付失败");
		log.info("支付失败");
		returnValue.setState(CS.FAIL);
		return returnValue;
	}

	/**
	 * 登录后预加载的基本
	 *
	 * @author snailzhang
	 * @date 2017年8月21日
	 *
	 */
	public void preCsairBaseInfoEx() {
		csairBaseInfoPageSrc = webClient.getCsairHtmlPage(Csair.URLCsairbaseInfoSrc, "URLCsairbaseInfoSrc", true);
		loadPageHandler(csairBaseInfoPageSrc, "//div[@class='alist']");
	}

	/**
	 * 明珠会员基本信息预加载
	 */
	@Override
	public Map<String, Object> preCsairBaseInfo() {
		Map<String, Object> map = new HashMap<String, Object>();
		csairBaseInfoPageSrc = webClient.getCsairHtmlPage(Csair.URLCsairbaseInfoSrc, "URLCsairbaseInfoSrc", false);
		CS cs = loadPageHandler(csairBaseInfoPageSrc, "//div[@class='alist']");
		if (CS.SUCCESS == cs) {
			HtmlPage pageSrc = csairBaseInfoPageSrc.getHtmlPage();
			String option = null;
			csairBaseInfoPageSrc.setLS(CS.SUCCESS);
			log.info("明珠会员基本信息src页状态==>" + csairBaseInfoPageSrc.getLS());
			map.put("sign", true);
			HtmlElement cardNo = (HtmlElement) pageSrc.getByXPath("//td[@class='tdstyle']").get(0);
			HtmlElement planName = (HtmlElement) pageSrc.getByXPath("//td[@class='tdstyle']").get(1);
			HtmlElement level = (HtmlElement) pageSrc.getByXPath("//td[@class='tdstyle']").get(2);
			HtmlElement stutas = (HtmlElement) pageSrc.getByXPath("//td[@class='tdstyle']").get(3);
			HtmlElement time = (HtmlElement) pageSrc.getByXPath("//td[@class='tdstyle']").get(4);
//			HtmlInput loginNo = pageSrc.getFirstByXPath("//input[@id='b2cName']");
			HtmlElement ChineseName = (HtmlElement) pageSrc.getByXPath("//td[@class='tdstyle']").get(5);
			HtmlElement EnglishName = (HtmlElement) pageSrc.getByXPath("//td[@class='tdstyle']").get(6);
			HtmlSelect titleSelect = pageSrc.getFirstByXPath("//select[@id='title']");
			HtmlInput birthday = pageSrc.getFirstByXPath("//input[@name='birthday']");
//			HtmlSelect zeroCertTypeSelect = pageSrc.getFirstByXPath("//select[@id='zeroCertType']");
//			HtmlElement IDNo = pageSrc.getFirstByXPath("//td[@id='zeroText']");
//			HtmlSelect oneCertTypeSelect = pageSrc.getFirstByXPath("//select[@id='oneCertType']");
//			HtmlElement IDNo1 = pageSrc.getFirstByXPath("//td[@id='oneText']");
//			HtmlSelect twoCertTypeSelect = pageSrc.getFirstByXPath("//select[@id='twoCertType']");
//			HtmlElement IDNo2 = pageSrc.getFirstByXPath("//td[@id='twoText']");
			HtmlSelect schoolLevel = pageSrc.getFirstByXPath("//select[@id='schoolLevel']");
			HtmlSelect professionCode = pageSrc.getFirstByXPath("//select[@id='professionCode']");
			HtmlInput professionTitle = pageSrc
					.getFirstByXPath("//input[@id='svcPcAllinfo.svcPcBasicInfoDto.professionTitle']");
			HtmlInput officeName = pageSrc.getFirstByXPath("//input[@id='svcPcAllinfo.svcPcBasicInfoDto.officeName']");
			HtmlSelect professionCodes = (HtmlSelect) pageSrc.getElementById("professionCode");
			DomNodeList<HtmlElement> codes = professionCodes.getElementsByTagName("option");
			for (Iterator<HtmlElement> iterator = codes.iterator(); iterator.hasNext();) {
				HtmlOption code = (HtmlOption) iterator.next();
				option += code.asXml();
			}
			map.put("professionCodes", option);
			map.put("cardNo", cardNo.asText());
			map.put("planName", planName.asText());
			map.put("level", level.asText());
			map.put("stutas", stutas.asText());
			map.put("time", time.asText());
//			map.put("loginNo", loginNo.getValueAttribute());
			map.put("ChineseName", ChineseName.asText());
			map.put("EnglishName", EnglishName.asText());
			map.put("title", titleSelect.asText());
			map.put("birthday", birthday.getValueAttribute());
//			map.put("zeroCertType", zeroCertTypeSelect.asText());
//			map.put("IDNo", IDNo.asText());
//			map.put("oneCertType", oneCertTypeSelect.asText());
//			map.put("IDNo1", IDNo1.asText());
//			map.put("twoCertType", twoCertTypeSelect.asText());
//			map.put("IDNo2", IDNo2.asText());
			map.put("schoolLevel", schoolLevel.asText());
			map.put("professionCode", professionCode.asText());
			map.put("professionTitle", professionTitle.asText());
			map.put("officeName", officeName.asText());
			return map;
		}
		map.put("sign", false);
		map.put("msg", "明珠会员基本信息加载超时!");
		return map;
	}

	/**
	 * 明珠会员基本信息保存
	 */
	@Override
	public CsairReturnValue csairBaseInfo(String b2cName, String title, String schoolLevel, String professionCode,
			String professionTitle, String officeName) {
		CsairReturnValue returnValue = new CsairReturnValue();

		HtmlPage pageSrc = csairBaseInfoPageSrc.getHtmlPage();

//		HtmlInput b2cNameInput = (HtmlInput) pageSrc.getFirstByXPath("//input[@id='b2cName']");
//		b2cNameInput.setValueAttribute(b2cName);

		HtmlSelect titleSelect = (HtmlSelect) pageSrc.getFirstByXPath("//select[@id='title']");
		titleSelect.setSelectedAttribute(title, true);

		log.info("schoolLevel======>" + schoolLevel);
		HtmlSelect schoolLevelSelect = (HtmlSelect) pageSrc.getFirstByXPath("//select[@id='schoolLevel']");
		schoolLevelSelect.setSelectedAttribute(schoolLevel, true);

		HtmlSelect professionCodeSelect = (HtmlSelect) pageSrc.getFirstByXPath("//select[@id='professionCode']");
		professionCodeSelect.setSelectedAttribute(professionCode, true);

		HtmlInput professionTitleInput = (HtmlInput) pageSrc
				.getFirstByXPath("//input[@id='svcPcAllinfo.svcPcBasicInfoDto.professionTitle']");
		professionTitleInput.setValueAttribute(professionTitle);

		HtmlInput officeNameInput = (HtmlInput) pageSrc
				.getFirstByXPath("//input[@id='svcPcAllinfo.svcPcBasicInfoDto.officeName']");
		officeNameInput.setValueAttribute(officeName);

		clickHandler(pageSrc.getElementById("savebutton"));
		returnValue.setMessage("保存!");
		return returnValue;
	}

	public void preCsairContactInfoEx() {
		csairContactInfoPageSrc = webClient.getCsairHtmlPage(Csair.URLCsairConnectInfoSrc, "URLCsairConnectInfoSrc",
				true);
		loadPageHandler(csairContactInfoPageSrc, "//div[@class='alist']");
	}

	public Map<String, Object> getAddress(String province) {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = csairContactInfoPageSrc.getHtmlPage();
		for (int i = 0; i <= timeoutmax; i++) {
			log.info("地址文件scl.URLaddressAction:" + scl.URLaddressAction);
			if (scl.URLaddressAction != null) {
				HtmlSelect select = page.getFirstByXPath("//select[@id='city']");
				map.put("city", select.asXml());
				scl.URLaddressAction = null;
				return map;
			}
			try {
				Thread.sleep(500);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			log.info("加载地址文件");
		}
		return map;
	}

	/**
	 * 预加载明珠会员联系信息
	 */
	@Override
	public Map<String, Object> preCsairContactInfo() {
		Map<String, Object> map = new HashMap<String, Object>();
		scl.URLcsairConnectInfoLoad = null;
		scl.URLdropdownAction = null;
		csairContactInfoPageSrc = webClient.getCsairHtmlPage(Csair.URLCsairConnectInfoSrc, "URLCsairConnectInfoSrc",
				false);
		CS cs = loadPageHandler(csairContactInfoPageSrc, "//div[@class='alist']");
		if (CS.SUCCESS == cs) {
			HtmlPage pageSrc = csairContactInfoPageSrc.getHtmlPage();
			csairContactInfoPageSrc.setLS(CS.SUCCESS);
			log.info("明珠会员联系信息src页状态==>" + csairContactInfoPageSrc.getLS());
			map.put("sign", true);

			try {
				Thread.sleep(8000);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			// for (int i = 0; i < timeoutmax; i++) {
			// if(scl.URLcsairConnectInfoLoad != null ){
			// log.info("scl.URLcsairConnectInfoLoad====>"+scl.URLcsairConnectInfoLoad);
			// log.info("scl.URLdropdownAction====>"+scl.URLdropdownAction);
			// if(scl.URLdropdownAction != null){
			// try {
			// Thread.sleep(300);
			// } catch (InterruptedException e) {
			// e.printStackTrace();
			// }
			// }
			// if(scl.URLcsairConnectInfoLoad != null){
			// try {
			// Thread.sleep(500);
			// } catch (InterruptedException e) {
			// e.printStackTrace();
			// }
			// }
			HtmlSelect languageSelect = (HtmlSelect) pageSrc.getElementById("svcPcAllinfo.svcPcBasicInfoDto.language");
			HtmlSelect countrySelect = (HtmlSelect) pageSrc.getElementById("country");

			HtmlInput postcodeInput = pageSrc.getFirstByXPath("//input[@id='postcode']");

			HtmlSelect provinceSelect = pageSrc.getFirstByXPath("//select[@id='province']");
			HtmlSelect citySelect = pageSrc.getFirstByXPath("//select[@id='city']");
			Iterable<DomElement> a = citySelect.getChildElements();
			String option = "";
			for (DomElement domElement : a) {
				option += domElement.asXml();
			}

			HtmlInput contactChoiceInput = pageSrc.getFirstByXPath("//input[@id='contactChoice']");
//			HtmlSelect country2Select = pageSrc.getFirstByXPath("//select[@id='country2']");
//
//			HtmlInput postcode2Input = pageSrc.getFirstByXPath("//input[@id='postcode2']");
//			HtmlInput provinceHid2Input = pageSrc.getFirstByXPath("//input[@id='provinceHid2']");
//			HtmlInput cityHid2Input = pageSrc.getFirstByXPath("//input[@id='cityHid2']");
//			HtmlInput address2Input = pageSrc.getFirstByXPath("//input[@id='address2']");
//			HtmlInput date1Input = pageSrc.getFirstByXPath("//input[@id='date1']");
//			HtmlInput date2Input = pageSrc.getFirstByXPath("//input[@id='date2']");
			HtmlSelect countryCodes0Select = pageSrc.getFirstByXPath("//select[@id='countryCodes0']");
			HtmlInput mobile1Input = pageSrc.getFirstByXPath("//input[@id='mobile1']");
			HtmlSelect countryCodes1Select = pageSrc.getFirstByXPath("//select[@id='countryCodes1']");
			HtmlInput mobile2Input = pageSrc.getFirstByXPath("//input[@id='mobile2']");
			HtmlSelect bandPhoneSelect = pageSrc.getFirstByXPath("//select[@id='bandPhone']");
			HtmlInput email1Input = pageSrc.getFirstByXPath("//input[@id='email1']");
			HtmlInput email2Input = pageSrc.getFirstByXPath("//input[@id='email2']");
			HtmlInput countryNum1Input = pageSrc.getFirstByXPath("//input[@id='countryNum1']");
			HtmlInput areaNum1Input = pageSrc.getFirstByXPath("//input[@id='areaNum1']");
			HtmlInput phoneNum1Input = pageSrc.getFirstByXPath("//input[@id='phoneNum1']");
//			HtmlInput extNum1Input = pageSrc.getFirstByXPath("//input[@id='extNum1']");
//			HtmlInput countryNum2Input = pageSrc.getFirstByXPath("//input[@id='countryNum2']");
//			HtmlInput areaNum2Input = pageSrc.getFirstByXPath("//input[@id='areaNum2']");
//			HtmlInput phoneNum2Input = pageSrc.getFirstByXPath("//input[@id='phoneNum2']");
//			HtmlInput extNum2Input = pageSrc.getFirstByXPath("//input[@id='extNum2']");
//			HtmlInput countryNum3Input = pageSrc.getFirstByXPath("//input[@id='countryNum3']");
//			HtmlInput areaNum3Input = pageSrc.getFirstByXPath("//input[@id='areaNum3']");
//			HtmlInput phoneNum3Input = pageSrc.getFirstByXPath("//input[@id='phoneNum3']");
//			HtmlInput extNum3Input = pageSrc.getFirstByXPath("//input[@id='extNum3']");
//			HtmlInput date3Input = pageSrc.getFirstByXPath("//input[@id='date3']");
//			HtmlInput date4Input = pageSrc.getFirstByXPath("//input[@id='date4']");
			HtmlInput countryNum4Input = pageSrc.getFirstByXPath("//input[@id='countryNum4']");
			HtmlInput areaNum4Input = pageSrc.getFirstByXPath("//input[@id='areaNum4']");
			HtmlInput phoneNum4Input = pageSrc.getFirstByXPath("//input[@id='phoneNum4']");
//			HtmlInput extNum4Input = pageSrc.getFirstByXPath("//input[@id='extNum4']");
//			HtmlInput textfield12Input = pageSrc.getFirstByXPath("//input[@id='textfield12']");
			HtmlInput textfield13Input = pageSrc.getFirstByXPath("//input[@id='textfield13']");

			map.put("language", languageSelect.asText());
			map.put("country", countrySelect.asText());
			map.put("postcode", postcodeInput.asText());
			map.put("provinceSelect", provinceSelect.asText());
			map.put("citySelect", citySelect.asText());
			map.put("cityOption", option);
			map.put("contactChoice", contactChoiceInput.asText());
//			map.put("country2", country2Select.asText());
//			map.put("postcode2", postcode2Input.asText());
//			map.put("provinceHid2", provinceHid2Input.asText());
//			map.put("cityHid2", cityHid2Input.asText());
//			map.put("address2", address2Input.asText());
//			map.put("date1", date1Input.asText());
//			map.put("date2", date2Input.asText());
			map.put("countryCodes0", countryCodes0Select.asText());
			map.put("mobile1", mobile1Input.asText());
			map.put("countryCodes1", countryCodes1Select.asText());
			map.put("mobile2", mobile2Input.asText());
			map.put("bandPhone", bandPhoneSelect.asText());
			map.put("email1", email1Input.asText());
			map.put("email2", email2Input.asText());
			map.put("countryNum1", countryNum1Input.asText());
			map.put("areaNum1", areaNum1Input.asText());
			map.put("phoneNum1", phoneNum1Input.asText());
//			map.put("extNum1", extNum1Input.asText());
//			map.put("countryNum2", countryNum2Input.asText());
//			map.put("areaNum2", areaNum2Input.asText());
//			map.put("phoneNum2", phoneNum2Input.asText());
//			map.put("extNum2", extNum2Input.asText());
//			map.put("countryNum3", countryNum3Input.asText());
//			map.put("areaNum3", areaNum3Input.asText());
//			map.put("phoneNum3", phoneNum3Input.asText());
//			map.put("extNum3", extNum3Input.asText());
//			map.put("date3", date3Input.asText());
//			map.put("date4", date4Input.asText());
			map.put("countryNum4", countryNum4Input.asText());
			map.put("areaNum4", areaNum4Input.asText());
			map.put("phoneNum4", phoneNum4Input.asText());
//			map.put("extNum4", extNum4Input.asText());
//			map.put("textfield12", textfield12Input.asText());
			map.put("textfield13", textfield13Input.asText());

			return map;

			// }
			// synchronized (pageSrc) {
			// try {
			// pageSrc.wait(500);
			// } catch (InterruptedException e) {
			// // TODO Auto-generated catch block
			// e.printStackTrace();
			// }
			// log.info("加载省市信息......");
			// }
			// }

		}
		map.put("sign", false);
		map.put("msg", "明珠会员联系信息加载超时!");
		return map;
	}

	/**
	 * 联系信息改变省
	 */
	@Override
	public CsairReturnValue changProvince(String province) {
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage pageSrc = csairContactInfoPageSrc.getHtmlPage();
		scl.URLcsairConnectInfoLoad = null;
		HtmlSelect provinceSelect = pageSrc.getFirstByXPath("//select[@id='province']");
		HtmlOption provinceOption = provinceSelect.getOptionByText(province);
		provinceOption.setSelected(true);
		provinceOption.type(9);
		log.info("更改省加载scl.URLcsairConnectInfoLoad===>" + scl.URLcsairConnectInfoLoad);
		for (int i = 0; i < timeoutmax; i++) {
			if (scl.URLcsairConnectInfoLoad != null) {
				try {
					Thread.sleep(1500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				returnValue.setState(CS.SUCCESS);
				return returnValue;
			}
		}
		return null;
	}

	/**
	 * 联系信息页面加载
	 */
	@Override
	public Map<String, Object> loadCsairContactPage() {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage pageSrc = csairContactInfoPageSrc.getHtmlPage();

		HtmlSelect languageSelect = (HtmlSelect) pageSrc.getElementById("svcPcAllinfo.svcPcBasicInfoDto.language");
		HtmlSelect countrySelect = (HtmlSelect) pageSrc.getElementById("country");
		// String countrySelectOptionValue =
		// countrySelect.getAttribute("selectedvalue");

		HtmlInput postcodeInput = pageSrc.getFirstByXPath("//input[@id='postcode']");
		// HtmlInput provinceHid1Input =
		// pageSrc.getFirstByXPath("//input[@id='provinceHid1']");
		// HtmlInput cityHid1Input = pageSrc.getFirstByXPath("//input[@id='cityHid1']");

		HtmlSelect provinceSelect = pageSrc.getFirstByXPath("//select[@id='province']");
		// log.info("provinceSelect====>"+provinceSelect.asText());
		HtmlSelect citySelect = pageSrc.getFirstByXPath("//select[@id='city']");
		Iterable<DomElement> a = citySelect.getChildElements();
		String option = "";
		for (DomElement domElement : a) {
			option += domElement.asXml();
		}

		HtmlInput contactChoiceInput = pageSrc.getFirstByXPath("//input[@id='contactChoice']");
//		HtmlSelect country2Select = pageSrc.getFirstByXPath("//select[@id='country2']");
		// String country2SelectOptionValue =
		// country2Select.getAttribute("selectedvalue");

//		HtmlInput postcode2Input = pageSrc.getFirstByXPath("//input[@id='postcode2']");
//		HtmlInput provinceHid2Input = pageSrc.getFirstByXPath("//input[@id='provinceHid2']");
//		HtmlInput cityHid2Input = pageSrc.getFirstByXPath("//input[@id='cityHid2']");
		// HtmlSelect province2Select =
		// pageSrc.getFirstByXPath("//select[@id='province2']");
		// HtmlSelect city2Select = pageSrc.getFirstByXPath("//select[@id='city2']");
//		HtmlInput address2Input = pageSrc.getFirstByXPath("//input[@id='address2']");
//		HtmlInput date1Input = pageSrc.getFirstByXPath("//input[@id='date1']");
//		HtmlInput date2Input = pageSrc.getFirstByXPath("//input[@id='date2']");
		HtmlSelect countryCodes0Select = pageSrc.getFirstByXPath("//select[@id='countryCodes0']");
		HtmlInput mobile1Input = pageSrc.getFirstByXPath("//input[@id='mobile1']");
		HtmlSelect countryCodes1Select = pageSrc.getFirstByXPath("//select[@id='countryCodes1']");
		HtmlInput mobile2Input = pageSrc.getFirstByXPath("//input[@id='mobile2']");
		HtmlSelect bandPhoneSelect = pageSrc.getFirstByXPath("//select[@id='bandPhone']");
		HtmlInput email1Input = pageSrc.getFirstByXPath("//input[@id='email1']");
		HtmlInput email2Input = pageSrc.getFirstByXPath("//input[@id='email2']");
		HtmlInput countryNum1Input = pageSrc.getFirstByXPath("//input[@id='countryNum1']");
		HtmlInput areaNum1Input = pageSrc.getFirstByXPath("//input[@id='areaNum1']");
		HtmlInput phoneNum1Input = pageSrc.getFirstByXPath("//input[@id='phoneNum1']");
//		HtmlInput extNum1Input = pageSrc.getFirstByXPath("//input[@id='extNum1']");
//		HtmlInput countryNum2Input = pageSrc.getFirstByXPath("//input[@id='countryNum2']");
//		HtmlInput areaNum2Input = pageSrc.getFirstByXPath("//input[@id='areaNum2']");
//		HtmlInput phoneNum2Input = pageSrc.getFirstByXPath("//input[@id='phoneNum2']");
//		HtmlInput extNum2Input = pageSrc.getFirstByXPath("//input[@id='extNum2']");
//		HtmlInput countryNum3Input = pageSrc.getFirstByXPath("//input[@id='countryNum3']");
//		HtmlInput areaNum3Input = pageSrc.getFirstByXPath("//input[@id='areaNum3']");
//		HtmlInput phoneNum3Input = pageSrc.getFirstByXPath("//input[@id='phoneNum3']");
//		HtmlInput extNum3Input = pageSrc.getFirstByXPath("//input[@id='extNum3']");
//		HtmlInput date3Input = pageSrc.getFirstByXPath("//input[@id='date3']");
//		HtmlInput date4Input = pageSrc.getFirstByXPath("//input[@id='date4']");
		HtmlInput countryNum4Input = pageSrc.getFirstByXPath("//input[@id='countryNum4']");
		HtmlInput areaNum4Input = pageSrc.getFirstByXPath("//input[@id='areaNum4']");
		HtmlInput phoneNum4Input = pageSrc.getFirstByXPath("//input[@id='phoneNum4']");
//		HtmlInput extNum4Input = pageSrc.getFirstByXPath("//input[@id='extNum4']");
//		HtmlInput textfield12Input = pageSrc.getFirstByXPath("//input[@id='textfield12']");
		HtmlInput textfield13Input = pageSrc.getFirstByXPath("//input[@id='textfield13']");

		// log.info("pageSrc===>" + pageSrc.asXml());
		// log.info("==============================================");
		// log.info("countrySelect==>" + countrySelect.asXml());
		// DomNodeList<HtmlElement> countries =
		// countrySelect.getElementsByTagName("option");
		// log.info("countries==>" + countries);
		// for (Iterator<HtmlElement> iterator = countries.iterator();
		// iterator.hasNext();) {
		// HtmlOption country = (HtmlOption) iterator.next();
		// String optionValue = country.getAttribute("value");
		// log.info("optionValue==>" + optionValue);
		// if (optionValue.equals(countrySelectOptionValue)) {
		// countryName = country.asText();
		// log.info("countryName===>" + countryName);
		// break;
		// }
		// }
		// DomNodeList<HtmlElement> countries2 =
		// country2Select.getElementsByTagName("option");
		// for (Iterator<HtmlElement> iterator = countries2.iterator();
		// iterator.hasNext();) {
		// HtmlOption country = (HtmlOption) iterator.next();
		// String optionValue = country.getAttribute("value");
		// if (optionValue.equals(country2SelectOptionValue)) {
		// countryName2 = country.asText();
		// log.info("countryName2===>" + countryName2);
		// break;
		// }
		// }

		map.put("language", languageSelect.asText());
		map.put("country", countrySelect.asText());
		map.put("postcode", postcodeInput.asText());
		map.put("provinceSelect", provinceSelect.asText());
		map.put("citySelect", citySelect.asText());
		map.put("cityOption", option);
		map.put("contactChoice", contactChoiceInput.asText());
//		map.put("country2", country2Select.asText());
//		map.put("postcode2", postcode2Input.asText());
//		map.put("provinceHid2", provinceHid2Input.asText());
//		map.put("cityHid2", cityHid2Input.asText());
//		map.put("address2", address2Input.asText());
//		map.put("date1", date1Input.asText());
//		map.put("date2", date2Input.asText());
		map.put("countryCodes0", countryCodes0Select.asText());
		map.put("mobile1", mobile1Input.asText());
		map.put("countryCodes1", countryCodes1Select.asText());
		map.put("mobile2", mobile2Input.asText());
		map.put("bandPhone", bandPhoneSelect.asText());
		map.put("email1", email1Input.asText());
		map.put("email2", email2Input.asText());
		map.put("countryNum1", countryNum1Input.asText());
		map.put("areaNum1", areaNum1Input.asText());
		map.put("phoneNum1", phoneNum1Input.asText());
//		map.put("extNum1", extNum1Input.asText());
//		map.put("countryNum2", countryNum2Input.asText());
//		map.put("areaNum2", areaNum2Input.asText());
//		map.put("phoneNum2", phoneNum2Input.asText());
//		map.put("extNum2", extNum2Input.asText());
//		map.put("countryNum3", countryNum3Input.asText());
//		map.put("areaNum3", areaNum3Input.asText());
//		map.put("phoneNum3", phoneNum3Input.asText());
//		map.put("extNum3", extNum3Input.asText());
//		map.put("date3", date3Input.asText());
//		map.put("date4", date4Input.asText());
		map.put("countryNum4", countryNum4Input.asText());
		map.put("areaNum4", areaNum4Input.asText());
		map.put("phoneNum4", phoneNum4Input.asText());
//		map.put("extNum4", extNum4Input.asText());
//		map.put("textfield12", textfield12Input.asText());
		map.put("textfield13", textfield13Input.asText());

		return map;
	}

	/**
	 * 明珠会员联系信息保存
	 */
	@Override
	public CsairReturnValue csairContactInfo(ContactInfo contactInfo) {
		CsairReturnValue returnValue = new CsairReturnValue();

		HtmlPage pageSrc = csairContactInfoPageSrc.getHtmlPage();

		returnValue.setCheckmodel(Boolean.FALSE);
		scl.URLsaveskypearlAction = null;

		HtmlSelect languageSelect = pageSrc.getFirstByXPath("//select[@id='svcPcAllinfo.svcPcBasicInfoDto.language']");
		languageSelect.setSelectedAttribute(contactInfo.getLanguage(), true);
		HtmlSelect countrySelect = pageSrc.getFirstByXPath("//select[@id='country']");
		countrySelect.setSelectedAttribute(contactInfo.getCountry(), true);
		HtmlInput postcodeInput = pageSrc.getFirstByXPath("//input[@id='postcode']");
		postcodeInput.setAttribute("value", contactInfo.getPostcode());
		HtmlSelect provinceSelect = pageSrc.getFirstByXPath("//select[@id='province']");
//		log.info("provinceSelect :" + provinceSelect.asXml());
		HtmlOption provinceOption = provinceSelect.getOptionByText(contactInfo.getProvince());
		provinceOption.setSelected(true);
		provinceOption.type(9);
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e1) {
			e1.printStackTrace();
		}
		HtmlSelect citySelect = pageSrc.getFirstByXPath("//select[@id='city']");
		Iterable<DomElement> a = citySelect.getChildElements();
		for (DomElement domElement : a) {
			String cityName = domElement.getAttribute("value");
			log.info(cityName + " : " + contactInfo.getCity());
			if (cityName.contains(contactInfo.getCity())) {
				HtmlOption cityOption = citySelect.getOptionByText(cityName);
				cityOption.setSelected(true);
				cityOption.type(9);
				break;
			}
		}

		// HtmlSelect provinceSelect =
		// pageSrc.getFirstByXPath("//select[@id='province']");
		// provinceSelect.setSelectedAttribute(province, true);
		// HtmlSelect citySelect = pageSrc.getFirstByXPath("//select[@id='city']");
		// citySelect.setSelectedAttribute(city, true);
		HtmlInput contactChoiceInput = pageSrc.getFirstByXPath("//input[@id='contactChoice']");
		contactChoiceInput.setAttribute("value", contactInfo.getContactChoice());
//		HtmlSelect country2Select = pageSrc.getFirstByXPath("//select[@id='country2']");
//		country2Select.setSelectedAttribute(contactInfo.getCountry2(), true);
//		HtmlInput postcode2Input = pageSrc.getFirstByXPath("//input[@id='postcode2']");
//		postcode2Input.setAttribute("value", contactInfo.getPostcode2());
//		HtmlInput provinceHid2Input = pageSrc.getFirstByXPath("//input[@id='provinceHid2']");
//		provinceHid2Input.setAttribute("value", contactInfo.getProvinceHid2());
//		HtmlInput cityHid2Input = pageSrc.getFirstByXPath("//input[@id='cityHid2']");
//		cityHid2Input.setAttribute("value", contactInfo.getCityHid2());
		// HtmlSelect province2Select =
		// pageSrc.getFirstByXPath("//select[@id='province2']");
		// province2Select.setSelectedAttribute(province2, true);
		// HtmlSelect city2Select = pageSrc.getFirstByXPath("//select[@id='city2']");
		// city2Select.setSelectedAttribute(city2, true);
//		HtmlInput address2Input = pageSrc.getFirstByXPath("//input[@id='address2']");
//		address2Input.setAttribute("value", contactInfo.getAddress2());
//		HtmlInput date1Input = pageSrc.getFirstByXPath("//input[@id='date1']");
//		date1Input.setAttribute("value", contactInfo.getDate1());
//		HtmlInput date2Input = pageSrc.getFirstByXPath("//input[@id='date2']");
//		date2Input.setAttribute("value", contactInfo.getDate2());
		HtmlSelect countryCodes0Select = pageSrc.getFirstByXPath("//select[@id='countryCodes0']");
		HtmlOption countryCodes0Option = countryCodes0Select.getOptionByText(contactInfo.getCountryCodes0());
		countryCodes0Option.setSelected(true);
		countryCodes0Option.type(9);
		// countryCodes0Select.setSelectedAttribute(contactInfo.getCountryCodes0(),
		// true);
		HtmlInput mobile1Input = pageSrc.getFirstByXPath("//input[@id='mobile1']");
		mobile1Input.setAttribute("value", contactInfo.getMobile1());
		HtmlSelect countryCodes1Select = pageSrc.getFirstByXPath("//select[@id='countryCodes1']");
		HtmlOption countryCodes1Option = countryCodes1Select.getOptionByText(contactInfo.getCountryCodes1());
		countryCodes1Option.setSelected(true);
		countryCodes1Option.type(9);
		HtmlInput mobile2Input = pageSrc.getFirstByXPath("//input[@id='mobile2']");
		mobile2Input.setAttribute("value", contactInfo.getMobile2());
		HtmlInput email1Input = pageSrc.getFirstByXPath("//input[@id='email1']");
		email1Input.setAttribute("value", contactInfo.getEmail1());
		HtmlInput email2Input = pageSrc.getFirstByXPath("//input[@id='email2']");
		email2Input.setAttribute("value", contactInfo.getEmail2());
		HtmlInput countryNum1Input = pageSrc.getFirstByXPath("//input[@id='countryNum1']");
		countryNum1Input.setAttribute("value", contactInfo.getCountryNum1());
		HtmlInput areaNum1Input = pageSrc.getFirstByXPath("//input[@id='areaNum1']");
		areaNum1Input.setAttribute("value", contactInfo.getAreaNum1());
		HtmlInput phoneNum1Input = pageSrc.getFirstByXPath("//input[@id='phoneNum1']");
		phoneNum1Input.setAttribute("value", contactInfo.getPhoneNum1());
//		HtmlInput extNum1Input = pageSrc.getFirstByXPath("//input[@id='extNum1']");
//		extNum1Input.setAttribute("value", contactInfo.getExtNum1());
//		HtmlInput countryNum2Input = pageSrc.getFirstByXPath("//input[@id='countryNum2']");
//		countryNum2Input.setAttribute("value", contactInfo.getCountryNum2());
//		HtmlInput areaNum2Input = pageSrc.getFirstByXPath("//input[@id='areaNum2']");
//		areaNum2Input.setAttribute("value", contactInfo.getAreaNum2());
//		HtmlInput phoneNum2Input = pageSrc.getFirstByXPath("//input[@id='phoneNum2']");
//		phoneNum2Input.setAttribute("value", contactInfo.getPhoneNum2());
//		HtmlInput extNum2Input = pageSrc.getFirstByXPath("//input[@id='extNum2']");
//		extNum2Input.setAttribute("value", contactInfo.getExtNum2());
//		HtmlInput countryNum3Input = pageSrc.getFirstByXPath("//input[@id='countryNum3']");
//		countryNum3Input.setAttribute("value", contactInfo.getCountryNum3());
//		HtmlInput areaNum3Input = pageSrc.getFirstByXPath("//input[@id='areaNum3']");
//		areaNum3Input.setAttribute("value", contactInfo.getAreaNum3());
//		HtmlInput phoneNum3Input = pageSrc.getFirstByXPath("//input[@id='phoneNum3']");
//		phoneNum3Input.setAttribute("value", contactInfo.getPhoneNum3());
//		HtmlInput extNum3Input = pageSrc.getFirstByXPath("//input[@id='extNum3']");
//		extNum3Input.setAttribute("value", contactInfo.getExtNum3());
//		HtmlInput date3Input = pageSrc.getFirstByXPath("//input[@id='date3']");
//		date3Input.setAttribute("value", contactInfo.getDate3());
//		HtmlInput date4Input = pageSrc.getFirstByXPath("//input[@id='date4']");
//		date4Input.setAttribute("value", contactInfo.getDate4());
		HtmlInput countryNum4Input = pageSrc.getFirstByXPath("//input[@id='countryNum4']");
		countryNum4Input.setAttribute("value", contactInfo.getCountryNum4());
		HtmlInput areaNum4Input = pageSrc.getFirstByXPath("//input[@id='areaNum4']");
		areaNum4Input.setAttribute("value", contactInfo.getAreaNum4());
		HtmlInput phoneNum4Input = pageSrc.getFirstByXPath("//input[@id='phoneNum4']");
		phoneNum4Input.setAttribute("value", contactInfo.getPhoneNum4());
//		HtmlInput extNum4Input = pageSrc.getFirstByXPath("//input[@id='extNum4']");
//		extNum4Input.setAttribute("value", contactInfo.getExtNum4());
//		HtmlInput textfield12Input = pageSrc.getFirstByXPath("//input[@id='textfield12']");
//		textfield12Input.setAttribute("value", contactInfo.getTextfield12());
		HtmlInput textfield13Input = pageSrc.getFirstByXPath("//input[@id='textfield13']");
		textfield13Input.setAttribute("value", contactInfo.getTextfield13());

		HtmlInput savebuttonInput = pageSrc.getFirstByXPath("//input[@id='savebutton']");
		clickHandler(savebuttonInput);
		log.info("联系信息点击保存!");

//		for (int i = 0; i < timeoutmax; i++) {
//			if (scl.URLsaveskypearlAction != null) {
				try {
					Thread.sleep(10000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				HtmlSpan span_postcode = pageSrc.getFirstByXPath("//span[@id='span_postcode']");
//				HtmlSpan span_date12 = pageSrc.getFirstByXPath("//span[@id='span_date12']");
				HtmlDivision alertDiv = pageSrc.getFirstByXPath("//div[@aria-labelledby='ui-dialog-title-2']");

				if (span_postcode.getAttribute("style").contains("display: inline;")) {
					returnValue.setState(CS.FAIL);
					returnValue.setMessage(span_postcode.asText());
					log.info(span_postcode.asText());
					return returnValue;
				} 
//				else if (span_date12.getAttribute("style").contains("display: inline;")) {
//					returnValue.setState(CS.FAIL);
//					returnValue.setMessage(span_date12.asText());
//					log.info(span_date12.asText());
//					return returnValue;
//				} 
				else if (alertDiv.getAttribute("style").contains("display: block;")) {
					returnValue.setState(CS.SUCCESS);
					returnValue.setCheckmodel(Boolean.TRUE);
					returnValue.setMessage("出现弹框!");
					log.info("有弹框!");
					Map<String, Object> map = new HashMap<String, Object>();
					HtmlDivision contentDiv = (HtmlDivision) pageSrc.getBody()
							.getElementsByAttribute("div", "class", "list2 ui-dialog-content ui-widget-content").get(0);
					// log.info("contentDiv.asXml()==>"+contentDiv.asXml());
					map.put("contentDiv", contentDiv.asXml());
					returnValue.setMap(map);
					return returnValue;
//				}
//				break;
//			}
//			synchronized (pageSrc) {
//				try {
//					pageSrc.wait(500);
//				} catch (InterruptedException e) {
//					// TODO Auto-generated catch block
//					e.printStackTrace();
//				}
//				log.info("联系信息保存加载中......");
//			}
		}

		returnValue.setState(CS.SUCCESS);
		returnValue.setMessage("没发现问题!");
		log.info("没发现问题");
		return returnValue;
	}

	/**
	 * 联系信息弹框校验
	 */
	@Override
	public CsairReturnValue csairContactInfoCheck(String info) {
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage pageSrc = csairContactInfoPageSrc.getHtmlPage();
		HtmlInput infoInput = pageSrc.getFirstByXPath("//input[@id='vaildConnectInfo']");
		infoInput.setAttribute("value", info);
		HtmlButton checkButton = pageSrc.getFirstByXPath("//button[@role='button']");
		pageSrc.setFocusedElement(checkButton);
		clickHandler(checkButton);
		try {
			Thread.sleep(5000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		if (alertMessage != null) {
			returnValue.setState(CS.FAIL);
			returnValue.setMessage(alertMessage);
			alertMessage = null;
			return returnValue;
		}
		HtmlDivision alertDiv = pageSrc.getFirstByXPath("//div[@aria-labelledby='ui-dialog-title-2']");
		if (alertDiv.getAttribute("style").contains("display: block;")) {
			returnValue.setState(CS.FAIL);
			returnValue.setMessage("校验失败!");
			log.info("校验失败!");
			return returnValue;
		}
		returnValue.setState(CS.SUCCESS);
		log.info("校验成功!");
		return returnValue;
	}

	/**
	 * 预加载明珠会员受让人管理
	 */
	@Override
	public CsairReturnValue precsairAssigneeCtrl() {
		CsairReturnValue returnValue = new CsairReturnValue();

		csairBaseInfoPage = webClient.getCsairHtmlPage(Csair.URLCsairbaseInfo, "URLCsairbaseInfo", false);
		CS cs = loadPageHandler(csairBaseInfoPage, "//a[@id='validator5']");
		if (CS.SUCCESS == cs) {
			HtmlPage page = csairBaseInfoPage.getHtmlPage();
			csairBaseInfoPage.setLS(CS.SUCCESS);
			log.info(csairBaseInfoPage.getLS());
//			HtmlElement stutas = (HtmlElement) page.getByXPath("//td[@class='tdstyle']").get(3);
//			String stutasText = stutas.asText();
//			log.info("是否认证:"+stutasText);
			HtmlElement a = page.getFirstByXPath("//a[@id='validator5']");
			clickHandler(a);
//			if("已认证".equals(stutasText)){
//				
//			}else{
				for (int i = 0; i < timeoutmax; i++) {
					HtmlDivision prompt_boxDiv = page.getFirstByXPath("//div[@id='prompt-box']");
					if (prompt_boxDiv != null) {
						HtmlButton successBtn = (HtmlButton) page.getByXPath("//button[@class='btnOne btn successBtn']").get(0);
						page = clickHandler(successBtn);
						returnValue.setState(CS.SUCCESS);
						returnValue.setCheckmodel(Boolean.TRUE);
						log.info("受让人弹框!");
						return returnValue;
					}
					if(scl.URLAssigneeCtrl != null){
						if(scl.URLAssigneeCtrljs != null){
							returnValue.setState(CS.SUCCESS);
							returnValue.setCheckmodel(Boolean.FALSE);
							log.info("受让人已认证页面!");
							scl.URLAssigneeCtrl = null;
							return returnValue;
						}
					}
					synchronized (page) {
						try {
							page.wait(500);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						log.info("加载在线认证提示框......");
					}
				}
//			}
			
			returnValue.setState(CS.FAIL);
			returnValue.setMessage("请登录明珠会员!");
			return returnValue;
		}

		csairBaseInfoPage.setLS(CS.TIMEOUT);
		log.info("明珠会员基本信息页面加载状态==>" + csairBaseInfoPage.getLS());
		returnValue.setState(CS.FAIL);
		returnValue.setMessage("加载超时!");
		return returnValue;
	}

	/**
	 * 加载受让人已验证页面
	 */
	@Override
	public CsairReturnValue preAssigneeCtrl() {
		CsairReturnValue returnValue = new CsairReturnValue();
		assigneeCtrlPage = webClient.getCsairHtmlPage(Csair.URLAssigneeCtrl, "URLAssigneeCtrl", false);
		CS cs = loadPageHandler(assigneeCtrlPage, "//span[@class='bn nexts']");
		if(CS.SUCCESS == cs){
			returnValue.setState(CS.SUCCESS);
		}else{
			returnValue.setState(CS.FAIL);
		}
		return returnValue;
	}

	
	/**
	 * 受让人管理已认证页面点击继续按钮
	 */
	@Override
	public Map<String , Object> AssigneeCtrlContinue() {
		Map<String , Object> map = new HashMap<String, Object>();
		HtmlPage page = assigneeCtrlPage.getHtmlPage();
		
		HtmlElement btn_sn = page.getBody().getElementsByAttribute("a", "class", "btn_sn changePages").get(0);
		clickHandler(btn_sn);
		for (int i = 0; i < timeoutmax; i++) {
			List<HtmlElement> dialogDivs = page.getBody().getElementsByAttribute("div", "role", "dialog");
			if(dialogDivs.size() != 0){
				HtmlDivision dialogDiv = (HtmlDivision) dialogDivs.get(0);
				String dialogDivStyle = dialogDiv.getAttribute("style");
				if(dialogDivStyle.contains("block")){
					String phoneNum = page.getElementById("bindPhone").asText();
					map.put("phoneNum", phoneNum);
					map.put("checkModel", "true");
					map.put("state", "SUCCESS");
					return map;
				}
			}
			if(page.getElementById("srrenset")!=null){
				scl.addAssignee = null;
				HtmlDivision srrensetDiv = (HtmlDivision) page.getElementById("srrenset");
				String srrensetDivStyle = srrensetDiv.getAttribute("style");
				if(srrensetDivStyle.contains("block")){
					HtmlDivision addOrchange1 = (HtmlDivision) page.getElementById("addOrchange1");
					if(addOrchange1 != null){
						log.info("变化后找到addOrchange1=====================================");
						HtmlAnchor addOrchange1A = (HtmlAnchor) addOrchange1.getElementsByTagName("a").get(0);
						clickHandler(addOrchange1A);
						for (int i1 = 0; i1 < timeoutmax; i1++) {
							if(scl.addAssignee != null) {
								HtmlTable table = (HtmlTable) page.getBody().getElementsByAttribute("table", "class", "user-cox-list").get(0);
								map.put("table", table.asXml());
								map.put("checkModel", "false");
								map.put("state", "SUCCESS");
								return map;
							}
							synchronized (page) {
								try {
									page.wait(100);
								} catch (InterruptedException e) {
									e.printStackTrace();
								}
								log.info("新增受让人加载中.....");
							}
						}
					}else {
						HtmlTable table = (HtmlTable) page.getBody().getElementsByAttribute("table", "class", "user-cox-list").get(0);
						map.put("table", table.asXml());
						map.put("checkModel", "false");
						map.put("state", "SUCCESS");
						return map;
					}
					
				}
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("弹框加载......");
			}
		}
		map.put("state", "FAIL");
		log.info("弹框加载失败!");
		return map;
	}
	
	/**
	 * 受让人管理已认证页面弹框获取验证码
	 * @return 
	 */
	@Override
	public CsairReturnValue AssigneeCtrlYzm() {
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = assigneeCtrlPage.getHtmlPage();
		HtmlElement sendCodeButton = (HtmlElement) page.getElementById("sendCode");
		clickHandler(sendCodeButton);
		log.info("已点击发送验证码!");
		returnValue.setMessage("已点击发送验证码按钮!");
		return returnValue;
	}
	
	/**
	 * 受让人管理已认证页面弹框校验
	 */
	@Override
	public CsairReturnValue AssigneeCtrlCheck(String yzm) {
		CsairReturnValue returnValue = new CsairReturnValue();
		Map<String , Object> map = new HashMap<String, Object>();
		HtmlPage page = assigneeCtrlPage.getHtmlPage();
		List<HtmlElement> cancelBtn = page.getBody().getElementsByAttribute("button", "class", "btnOne btn cancelBtn");
		if(cancelBtn.size() > 0){
			try {
				cancelBtn.get(0).click();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		HtmlInput codeInput = (HtmlInput) page.getElementById("code");
		codeInput.setValueAttribute(yzm);
		codeInput.blur();
		HtmlElement vaildCodeButton = (HtmlElement) page.getElementById("vaildCode");
		clickHandler(vaildCodeButton);
		log.info("变化前================================");
		for (int i = 0; i < timeoutmax; i++) {
			
			if(page.getElementById("srrenset")!=null){
				scl.addAssignee = null;
				HtmlDivision srrensetDiv = (HtmlDivision) page.getElementById("srrenset");
				String srrensetDivStyle = srrensetDiv.getAttribute("style");
				if(srrensetDivStyle.contains("block")){
					HtmlDivision addOrchange1 = (HtmlDivision) page.getElementById("addOrchange1");
					if(addOrchange1 != null){
						log.info("变化后找到addOrchange1=====================================");
						HtmlAnchor addOrchange1A = (HtmlAnchor) addOrchange1.getElementsByTagName("a").get(0);
						clickHandler(addOrchange1A);
						try {
							Thread.sleep(2000);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						HtmlTable table = (HtmlTable) page.getBody().getElementsByAttribute("table", "class", "user-cox-list").get(0);
						map.put("table", table.asXml());
						returnValue.setMap(map);
						returnValue.setState(CS.SUCCESS);
						return returnValue;
							
					}else {
						HtmlTable table = (HtmlTable) page.getBody().getElementsByAttribute("table", "class", "user-cox-list").get(0);
						map.put("table", table.asXml());
						returnValue.setMap(map);
						returnValue.setState(CS.SUCCESS);
						return returnValue;
					}
					
				}
			}
			
//			HtmlDivision addOrchange1 = (HtmlDivision) page.getElementById("addOrchange1");
//			if(addOrchange1 != null){
//				scl.addAssignee = null;
//				log.info("变化后找到addOrchange1=====================================");
//				HtmlAnchor addOrchange1A = (HtmlAnchor) addOrchange1.getElementsByTagName("a").get(0);
//				clickHandler(addOrchange1A);
//				for (int i1 = 0; i1 < timeoutmax; i1++) {
//					if(scl.addAssignee != null) {
//						
//						HtmlTable table = (HtmlTable) page.getBody().getElementsByAttribute("table", "class", "user-cox-list").get(0);
//						map.put("table", table.asXml());
//						returnValue.setMap(map);
//						returnValue.setState(CS.SUCCESS);
//						return returnValue;
//					}
//					synchronized (page) {
//						try {
//							page.wait(500);
//						} catch (InterruptedException e) {
//							e.printStackTrace();
//						}
//						log.info("新增受让人加载中.....");
//					}
//				}
//			}
//			
//			if(page.getElementById("firstNameCN1")!=null){
//				log.info("变化后找到firstNameCN1=====================================");
//				HtmlTable table = (HtmlTable) page.getBody().getElementsByAttribute("table", "class", "user-cox-list").get(0);
//				map.put("table", table.asXml());
//				returnValue.setMap(map);
//				returnValue.setState(CS.SUCCESS);
//				return returnValue;
//			}
			if(page.getElementById("prompt-box") != null){
				returnValue.setState(CS.FAIL);
				returnValue.setMessage("校验不通过!");
				return returnValue;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				returnValue.setState(CS.LOADING);
				log.info("受让人填写页面加载........");
			}
		}
		returnValue.setState(CS.FAIL);
		returnValue.setMessage("受让人填写页面加载失败!");
		log.info("受让人填写页面加载失败!");
		return returnValue;
	}

	/**
	 * 受让人删除
	 */
	@Override
	public CsairReturnValue AssigneeCtrlDel(List<String> list) {
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = assigneeCtrlPage.getHtmlPage();
		
		for (int i = 0; i < list.size(); i++) {
			String id = list.get(i);
			log.info("被选中的id===>"+id);
			HtmlInput CheckBox = (HtmlInput) page.getElementById(id);
			clickHandler(CheckBox);
		}
		
		HtmlElement deleteBtn = (HtmlElement) page.getElementById("delete");
		HtmlSpan span = (HtmlSpan) deleteBtn.getElementsByTagName("span").get(0);
		clickHandler(span);
		
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e1) {
			e1.printStackTrace();
		}
		
//		log.info(page.asXml());
		for (int i = 0; i < timeoutmax; i++) {
			log.info("=================="+page.getElementById("prompt-box"));
			if(page.getElementById("prompt-box") != null){
				String BoxContent = page.getBody().getElementsByAttribute("div", "class", "promptBoxContent").get(0).asText();
				returnValue.setMessage(BoxContent);
				returnValue.setState(CS.FAIL);
				HtmlButton cancelBtn = (HtmlButton) page.getBody().getElementsByAttribute("div", "class", "btnOne btn cancelBtn").get(0);
				clickHandler(cancelBtn);
				return returnValue;
			}
			
			List<HtmlElement> twiceChecks = page.getBody().getElementsByAttribute("div", "class", "tempDialogDiv");
			log.info("twiceChecks.size()====>"+twiceChecks.size());
			if(twiceChecks.size() != 0) {
				HtmlDivision twiceCheck = (HtmlDivision) twiceChecks.get(0);
				Map<String, Object> map = new HashMap<String, Object>();
				map.put("twiceCheck", twiceCheck.asXml());
				returnValue.setMap(map);
				returnValue.setState(CS.SUCCESS);
				return returnValue;
			}
				
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				returnValue.setState(CS.LOADING);
				log.info("点击删除加载中.....");
			}
		}
		returnValue.setMessage("点击保存后加载超时!");
		returnValue.setState(CS.FAIL);
		return returnValue;
	}

	
	
	
	/**
	 * 受让人保存
	 */
	@Override
	public CsairReturnValue AssigneeCtrlSave(Assignee assignee) {
		scl.addAssignee = null;
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = assigneeCtrlPage.getHtmlPage();
		HtmlInput firstNameCN1Input = (HtmlInput) page.getElementById("firstNameCN1");
		firstNameCN1Input.focus();
		firstNameCN1Input.setValueAttribute(assignee.getFirstNameCN1());
		firstNameCN1Input.blur();
		HtmlInput lastNameCN1Input = (HtmlInput) page.getElementById("lastNameCN1");
		lastNameCN1Input.focus();
		lastNameCN1Input.setValueAttribute(assignee.getLastNameCN1());
		lastNameCN1Input.blur();
		HtmlInput inputcertificateIdnum1Input = (HtmlInput) page.getElementById("inputcertificateIdnum1");
		inputcertificateIdnum1Input.focus();
		inputcertificateIdnum1Input.setValueAttribute(assignee.getInputcertificateIdnum1());
		inputcertificateIdnum1Input.blur();
		HtmlInput inputpassport1Input = (HtmlInput) page.getElementById("inputpassport1");
		inputpassport1Input.focus();
		inputpassport1Input.setValueAttribute(assignee.getInputpassport1());
		inputpassport1Input.blur();
		HtmlInput inputotherCertificate1Input = (HtmlInput) page.getElementById("inputotherCertificate1");
		inputotherCertificate1Input.focus();
		inputotherCertificate1Input.setValueAttribute(assignee.getInputotherCertificate1());
		inputotherCertificate1Input.blur();
		
		HtmlInput firstNameCN2Input = (HtmlInput) page.getElementById("firstNameCN2");
		firstNameCN2Input.focus();
		firstNameCN2Input.setValueAttribute(assignee.getFirstNameCN2());
		firstNameCN2Input.blur();
		HtmlInput lastNameCN2Input = (HtmlInput) page.getElementById("lastNameCN2");
		lastNameCN2Input.focus();
		lastNameCN2Input.setValueAttribute(assignee.getLastNameCN2());
		lastNameCN2Input.blur();
		HtmlInput inputcertificateIdnum2Input = (HtmlInput) page.getElementById("inputcertificateIdnum2");
		inputcertificateIdnum2Input.focus();
		inputcertificateIdnum2Input.setValueAttribute(assignee.getInputcertificateIdnum2());
		inputcertificateIdnum2Input.blur();
		HtmlInput inputpassport2Input = (HtmlInput) page.getElementById("inputpassport2");
		inputpassport2Input.focus();
		inputpassport2Input.setValueAttribute(assignee.getInputpassport2());
		inputpassport2Input.blur();
		HtmlInput inputotherCertificate2Input = (HtmlInput) page.getElementById("inputotherCertificate2");
		inputotherCertificate2Input.focus();
		inputotherCertificate2Input.setValueAttribute(assignee.getInputotherCertificate2());
		inputotherCertificate2Input.blur();
		
		HtmlInput firstNameCN3Input = (HtmlInput) page.getElementById("firstNameCN3");
		firstNameCN3Input.focus();
		firstNameCN3Input.setValueAttribute(assignee.getFirstNameCN3());
		firstNameCN3Input.blur();
		HtmlInput lastNameCN3Input = (HtmlInput) page.getElementById("lastNameCN3");
		lastNameCN3Input.focus();
		lastNameCN3Input.setValueAttribute(assignee.getLastNameCN3());
		lastNameCN3Input.blur();
		HtmlInput inputcertificateIdnum3Input = (HtmlInput) page.getElementById("inputcertificateIdnum3");
		inputcertificateIdnum3Input.focus();
		inputcertificateIdnum3Input.setValueAttribute(assignee.getInputcertificateIdnum3());
		inputcertificateIdnum3Input.blur();
		HtmlInput inputpassport3Input = (HtmlInput) page.getElementById("inputpassport3");
		inputpassport3Input.focus();
		inputpassport3Input.setValueAttribute(assignee.getInputpassport3());
		inputpassport3Input.blur();
		HtmlInput inputotherCertificate3Input = (HtmlInput) page.getElementById("inputotherCertificate3");
		inputotherCertificate3Input.focus();
		inputotherCertificate3Input.setValueAttribute(assignee.getInputotherCertificate3());
		inputotherCertificate3Input.blur();
		
		HtmlInput firstNameCN4Input = (HtmlInput) page.getElementById("firstNameCN4");
		firstNameCN4Input.focus();
		firstNameCN4Input.setValueAttribute(assignee.getFirstNameCN4());
		firstNameCN4Input.blur();
		HtmlInput lastNameCN4Input = (HtmlInput) page.getElementById("lastNameCN4");
		lastNameCN4Input.focus();
		lastNameCN4Input.setValueAttribute(assignee.getLastNameCN4());
		lastNameCN4Input.blur();
		HtmlInput inputcertificateIdnum4Input = (HtmlInput) page.getElementById("inputcertificateIdnum4");
		inputcertificateIdnum4Input.focus();
		inputcertificateIdnum4Input.setValueAttribute(assignee.getInputcertificateIdnum4());
		inputcertificateIdnum4Input.blur();
		HtmlInput inputpassport4Input = (HtmlInput) page.getElementById("inputpassport4");
		inputpassport4Input.focus();
		inputpassport4Input.setValueAttribute(assignee.getInputpassport4());
		inputpassport4Input.blur();
		HtmlInput inputotherCertificate4Input = (HtmlInput) page.getElementById("inputotherCertificate4");
		inputotherCertificate4Input.focus();
		inputotherCertificate4Input.setValueAttribute(assignee.getInputotherCertificate4());
		inputotherCertificate4Input.blur();
		
		HtmlInput firstNameCN5Input = (HtmlInput) page.getElementById("firstNameCN5");
		firstNameCN5Input.focus();
		firstNameCN5Input.setValueAttribute(assignee.getFirstNameCN5());
		firstNameCN5Input.blur();
		HtmlInput lastNameCN5Input = (HtmlInput) page.getElementById("lastNameCN5");
		lastNameCN5Input.focus();
		lastNameCN5Input.setValueAttribute(assignee.getLastNameCN5());
		lastNameCN5Input.blur();
		HtmlInput inputcertificateIdnum5Input = (HtmlInput) page.getElementById("inputcertificateIdnum5");
		inputcertificateIdnum5Input.focus();
		inputcertificateIdnum5Input.setValueAttribute(assignee.getInputcertificateIdnum5());
		inputcertificateIdnum5Input.blur();
		HtmlInput inputpassport5Input = (HtmlInput) page.getElementById("inputpassport5");
		inputpassport5Input.focus();
		inputpassport5Input.setValueAttribute(assignee.getInputpassport5());
		inputpassport5Input.blur();
		HtmlInput inputotherCertificate5Input = (HtmlInput) page.getElementById("inputotherCertificate5");
		inputotherCertificate5Input.focus();
		inputotherCertificate5Input.setValueAttribute(assignee.getInputotherCertificate5());
		inputotherCertificate5Input.blur();
		
		HtmlInput firstNameCN6Input = (HtmlInput) page.getElementById("firstNameCN6");
		firstNameCN6Input.focus();
		firstNameCN6Input.setValueAttribute(assignee.getFirstNameCN6());
		firstNameCN6Input.blur();
		HtmlInput lastNameCN6Input = (HtmlInput) page.getElementById("lastNameCN6");
		lastNameCN6Input.focus();
		lastNameCN6Input.setValueAttribute(assignee.getLastNameCN6());
		lastNameCN6Input.blur();
		HtmlInput inputcertificateIdnum6Input = (HtmlInput) page.getElementById("inputcertificateIdnum6");
		inputcertificateIdnum6Input.focus();
		inputcertificateIdnum6Input.setValueAttribute(assignee.getInputcertificateIdnum6());
		inputcertificateIdnum6Input.blur();
		HtmlInput inputpassport6Input = (HtmlInput) page.getElementById("inputpassport6");
		inputpassport6Input.focus();
		inputpassport6Input.setValueAttribute(assignee.getInputpassport6());
		inputpassport6Input.blur();
		HtmlInput inputotherCertificate6Input = (HtmlInput) page.getElementById("inputotherCertificate6");
		inputotherCertificate6Input.focus();
		inputotherCertificate6Input.setValueAttribute(assignee.getInputotherCertificate6());
		inputotherCertificate6Input.blur();
		
		HtmlInput firstNameCN7Input = (HtmlInput) page.getElementById("firstNameCN7");
		firstNameCN7Input.focus();
		firstNameCN7Input.setValueAttribute(assignee.getFirstNameCN7());
		firstNameCN7Input.blur();
		HtmlInput lastNameCN7Input = (HtmlInput) page.getElementById("lastNameCN7");
		lastNameCN7Input.focus();
		lastNameCN7Input.setValueAttribute(assignee.getLastNameCN7());
		lastNameCN7Input.blur();
		HtmlInput inputcertificateIdnum7Input = (HtmlInput) page.getElementById("inputcertificateIdnum7");
		inputcertificateIdnum7Input.focus();
		inputcertificateIdnum7Input.setValueAttribute(assignee.getInputcertificateIdnum7());
		inputcertificateIdnum7Input.blur();
		HtmlInput inputpassport7Input = (HtmlInput) page.getElementById("inputpassport7");
		inputpassport7Input.focus();
		inputpassport7Input.setValueAttribute(assignee.getInputpassport7());
		inputpassport7Input.blur();
		HtmlInput inputotherCertificate7Input = (HtmlInput) page.getElementById("inputotherCertificate7");
		inputotherCertificate7Input.focus();
		inputotherCertificate7Input.setValueAttribute(assignee.getInputotherCertificate7());
		inputotherCertificate7Input.blur();
		
		HtmlInput firstNameCN8Input = (HtmlInput) page.getElementById("firstNameCN8");
		firstNameCN8Input.focus();
		firstNameCN8Input.setValueAttribute(assignee.getFirstNameCN8());
		firstNameCN8Input.blur();
		HtmlInput lastNameCN8Input = (HtmlInput) page.getElementById("lastNameCN8");
		lastNameCN8Input.focus();
		lastNameCN8Input.setValueAttribute(assignee.getLastNameCN8());
		lastNameCN8Input .blur();
		HtmlInput inputcertificateIdnum8Input = (HtmlInput) page.getElementById("inputcertificateIdnum8");
		inputcertificateIdnum8Input.focus();
		inputcertificateIdnum8Input.setValueAttribute(assignee.getInputcertificateIdnum8());
		inputcertificateIdnum8Input.blur();
		HtmlInput inputpassport8Input = (HtmlInput) page.getElementById("inputpassport8");
		inputpassport8Input.focus();
		inputpassport8Input.setValueAttribute(assignee.getInputpassport8());
		inputpassport8Input.blur();
		HtmlInput inputotherCertificate8Input = (HtmlInput) page.getElementById("inputotherCertificate8");
		inputotherCertificate8Input.focus();
		inputotherCertificate8Input.setValueAttribute(assignee.getInputotherCertificate8());
		inputotherCertificate8Input.blur();
	
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e1) {
			e1.printStackTrace();
		}
		
		HtmlElement save2 = (HtmlElement) page.getElementById("save2");
		HtmlSpan span = (HtmlSpan) save2.getElementsByTagName("span").get(0);
		clickHandler(span);
		
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e1) {
			e1.printStackTrace();
		}
		
//		log.info(page.asXml());
		for (int i = 0; i < timeoutmax; i++) {
			if(page.getElementById("prompt-box") != null){
				String BoxContent = page.getBody().getElementsByAttribute("div", "class", "promptBoxContent").get(0).asText();
				returnValue.setMessage(BoxContent);
				returnValue.setState(CS.FAIL);
				HtmlButton cancelBtn = (HtmlButton) page.getBody().getElementsByAttribute("div", "class", "btnOne btn cancelBtn").get(0);
				clickHandler(cancelBtn);
				return returnValue;
			}
			
			List<HtmlElement> twiceChecks = page.getBody().getElementsByAttribute("div", "class", "tempDialogDiv");
			log.info("twiceChecks.size()====>"+twiceChecks.size());
			if(twiceChecks.size() != 0) {
				HtmlDivision twiceCheck = (HtmlDivision) twiceChecks.get(0);
				Map<String, Object> map = new HashMap<String, Object>();
				map.put("twiceCheck", twiceCheck.asXml());
				returnValue.setMap(map);
				returnValue.setState(CS.SUCCESS);
				return returnValue;
			}
				
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				returnValue.setState(CS.LOADING);
				log.info("点击保存加载中.....");
			}
		}
		returnValue.setMessage("点击保存后加载超时!");
		returnValue.setState(CS.FAIL);
		return returnValue;
	}
	
	/**
	 * 受让人二次确认取消
	 */
	@Override
	public CsairReturnValue AssigneeTwiceCheckQuit() {
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = assigneeCtrlPage.getHtmlPage();
		HtmlSpan closeSpan = (HtmlSpan) page.getBody().getElementsByAttribute("span", "class", "close").get(0);
		HtmlInput closeButtonInput = (HtmlInput) closeSpan.getElementsByTagName("input").get(0);
		clickHandler(closeButtonInput);
		for (int i = 0; i < timeoutmax; i++) {
			int a = 0;
			List<HtmlElement> twiceChecks = page.getBody().getElementsByAttribute("div", "title", "二次确认");
			for (int j = 0; j < twiceChecks.size(); j++) {
				HtmlElement twiceCheck = twiceChecks.get(j);
				String twiceCheckStyle = twiceCheck.getAttribute("style");
				if(twiceCheckStyle.contains("block")){
					a++;
				}
			}
			if(a == 0) {
				returnValue.setState(CS.SUCCESS);
				return returnValue;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				returnValue.setState(CS.LOADING);
				log.info("等待取消二次确认....");
			}
		}
		returnValue.setState(CS.FAIL);
		log.info("取消失败!");
		return returnValue;
	}

	/**
	 * 受让人确认二次确认
	 */
	@Override
	public CsairReturnValue AssigneeTwiceCheckBtn() {
		alertMessage = null;
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = assigneeCtrlPage.getHtmlPage();
		HtmlInput twiceSaveInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "value", "确定").get(0);
		clickHandler(twiceSaveInput);
		for (int i = 0; i < timeoutmax; i++) {
			if(alertMessage != null) {
				returnValue.setMessage(alertMessage);
				returnValue.setState(CS.SUCCESS);
				return returnValue;
			}
			synchronized (page) {
				try {
					page.wait(200);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("等待弹框.......");
			}
		}
		returnValue.setMessage("点击确认键");
		return returnValue;
	}

	
	/**
	 * 预加载在线身份认证
	 */
	@Override
	public Map<String, Object> preCsairOnlineIdentityAuthentication() {
		Map<String, Object> map = new HashMap<String, Object>();
		csairOnlineIdentityAuthenticationPageSrc = webClient.getCsairHtmlPage(
				Csair.URLCsairOnlineIdentityAuthenticationSrc, "URLCsairOnlineIdentityAuthenticationSrc", true);
		CS cs = loadPageHandler(csairOnlineIdentityAuthenticationPageSrc, "//div[@class='alist']");
		if (CS.SUCCESS == cs) {
			// HtmlPage pageSrc = csairOnlineIdentityAuthenticationPageSrc.getHtmlPage();
			csairOnlineIdentityAuthenticationPageSrc.setLS(CS.SUCCESS);
			log.info("明珠会员在线身份验证src页状态==>" + csairOnlineIdentityAuthenticationPageSrc.getLS());
			map.put("sign", true);
			return map;
		}
		csairOnlineIdentityAuthenticationPageSrc.setLS(CS.TIMEOUT);
		log.info("明珠会员在线身份验证src页状态==>" + csairOnlineIdentityAuthenticationPageSrc.getLS());
		map.put("sign", false);
		map.put("msg", "明珠会员联系信息加载超时!");
		return map;

	}

	/**
	 * 加载同意在线身份认证页面
	 */
	@Override
	public Map<String, Object> agreeCsairOnlineIdentityAuthentication() {
		Map<String, Object> map = new HashMap<String, Object>();
		agreeCsairOnlineIdentityAuthenticationPage = webClient.getCsairHtmlPage(
				Csair.URLAgreeCsairOnlineIdentityAuthentication, "URLAgreeCsairOnlineIdentityAuthentication", false);

		CS cs = loadPageHandler(agreeCsairOnlineIdentityAuthenticationPage, "//input[@id='memberNo']");
		if (CS.SUCCESS == cs) {
			HtmlPage page = agreeCsairOnlineIdentityAuthenticationPage.getHtmlPage();
			agreeCsairOnlineIdentityAuthenticationPage.setLS(CS.SUCCESS);
			log.info("同意在线身份认证页面加载状态==>" + agreeCsairOnlineIdentityAuthenticationPage.getLS());

			HtmlInput memberNoInput = (HtmlInput) page.getElementById("memberNo");
			String memberNo = memberNoInput.getAttribute("value");
			map.put("memberNo", memberNo);
			HtmlInput fullNameInput = (HtmlInput) page.getElementById("fullName");
			String fullName = fullNameInput.getAttribute("value");
			map.put("fullName", fullName);
			HtmlInput certNumInput = (HtmlInput) page.getElementById("certNum");
			String certNum = certNumInput.getAttribute("value");
			map.put("certNum", certNum);
			// HtmlInput bandPhonehiddenInput = (HtmlInput)
			// page.getElementById("bandPhonehidden");
			// String bandPhonehidden = bandPhonehiddenInput.getAttribute("value");
			// map.put("bandPhonehidden", bandPhonehidden);
			return map;
		}
		agreeCsairOnlineIdentityAuthenticationPage.setLS(CS.TIMEOUT);
		log.info("同意在线身份认证页面加载状态==>" + agreeCsairOnlineIdentityAuthenticationPage.getLS());
		map.put("sign", false);
		return map;
	}

	/**
	 * 同意身份验证发送验证码
	 */
	@Override
	public CsairReturnValue agreeCsairOnlineIdentityAuthenticationVerifCode(String bandPhone) {
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = agreeCsairOnlineIdentityAuthenticationPage.getHtmlPage();

		HtmlInput changemobilebuttonInput = page.getFirstByXPath("//input[@id='changemobilebutton']");
		clickHandler(changemobilebuttonInput);
		HtmlInput bandPhonehiddenInput = page.getFirstByXPath("//input[@id='bandPhonehidden']");
		bandPhonehiddenInput.focus();
		bandPhonehiddenInput.setValueAttribute(bandPhone);
		bandPhonehiddenInput.blur();
		HtmlInput sendValidateCodeInput = page.getFirstByXPath("//input[@id='sendValidateCode']");
		clickHandler(sendValidateCodeInput);
		try {
			Thread.sleep(5000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		HtmlSpan noticeSpan = page.getFirstByXPath("//span[@id='notice']");
		HtmlInput sendValidateCodeInput1 = page.getFirstByXPath("//input[@id='sendValidateCode']");
		if (sendValidateCodeInput1.getAttribute("value").contains("可再发送")) {
			returnValue.setMessage(alertMessage);
			sendValidateCodeInput.type(13);
			log.info("alertMessage===>"+alertMessage);
			alertMessage = null;
		}
		if (noticeSpan.getAttribute("style").contains(" display: block;")) {
			returnValue.setMessage(noticeSpan.asText());
			log.info("noticeSpan.asText()===>"+noticeSpan.asText());
		}
		return returnValue;
	}

	/**
	 * 借记卡申请在线身份验证
	 */
	@Override
	public CsairReturnValue Debit_cardOnlineIdentityAuthentication(String certType, String bankcardType,
			String bankcardNo, String validateCode) {
		scl.onlineIdentityAuthentication = null;
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = agreeCsairOnlineIdentityAuthenticationPage.getHtmlPage();
		HtmlSelect certTypeSelect = page.getFirstByXPath("//select[@id='certType']");
		certTypeSelect.focus();
		HtmlOption certTypeOption = certTypeSelect.getOptionByText(certType);
		certTypeOption.setSelected(true);
		certTypeOption.type(9);
//		log.info("certTypeSelect==>" + certTypeSelect.asXml());
		HtmlSelect bankcardTypeSelect = page.getFirstByXPath("//select[@id='bankcardType']");
		bankcardTypeSelect.focus();
		HtmlOption bankcardTypeOption = bankcardTypeSelect.getOptionByText(bankcardType);
		bankcardTypeOption.setSelected(true);
		bankcardTypeOption.type(9);
//		log.info("bankcardTypeSelect==>" + bankcardTypeSelect.asXml());
		HtmlInput bankcardNoInput = page.getFirstByXPath("//input[@id='bankcardNo']");
		bankcardNoInput.focus();
		bankcardNoInput.setAttribute("value", bankcardNo);
		bankcardNoInput.blur();
//		log.info("bankcardNoInput===>" + bankcardNoInput.asXml());
		HtmlInput validateCodeInput = page.getFirstByXPath("//input[@id='validateCode']");
		validateCodeInput.focus();
		validateCodeInput.setAttribute("value", validateCode);
		validateCodeInput.blur();
//		log.info("validateCodeInput==>" + validateCodeInput.asXml());
		HtmlElement aButton = page.getFirstByXPath("//a[@id='savebutton']");
//		log.info("aButton===>" + aButton.asXml());
		page = clickHandler(aButton);
		// try {
		// log.info("借记卡点击申请后的page==>" + page);
		// Thread.sleep(2000);
		// } catch (InterruptedException e) {
		// e.printStackTrace();
		// }
		for (int i = 0; i < timeoutmax; i++) {
			if(scl.onlineIdentityAuthentication != null) {
				HtmlSpan noticeSpan = (HtmlSpan) page.getElementById("notice");
				log.info("noticeSpan====>" + noticeSpan.asText());
				if (noticeSpan.getAttribute("style").contains("block")) {
					returnValue.setState(CS.FAIL);
					returnValue.setMessage(noticeSpan.asText());
					log.info("noticeSpan.asText()===>"+noticeSpan.asText());
					return returnValue;
				}else {
					break;
				}
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("文件加载中.....");
			}
		}
		
		log.info("没发现问题!");
		returnValue.setState(CS.SUCCESS);
		return returnValue;
	}

	/**
	 * 信用卡申请在线身份验证
	 */
	@Override
	public CsairReturnValue Credit_cardOnlineIdentityAuthentication(String certType, String cCardNo, String effMonth,
			String effYear, String saveCode, String validateCode) {
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = agreeCsairOnlineIdentityAuthenticationPage.getHtmlPage();

		HtmlInput bankTypeCInput = page.getFirstByXPath("//input[@id='bankTypeC']");
		clickHandler(bankTypeCInput);
		HtmlSelect certTypeSelect = page.getFirstByXPath("//select[@id='certType']");
		certTypeSelect.setSelectedAttribute(certType, true);
		HtmlInput cCardNoInput = page.getFirstByXPath("//input[@id='cCardNo']");
		cCardNoInput.setAttribute("value", cCardNo);
		HtmlSelect effMonthSelect = page.getFirstByXPath("//select[@id='effMonth']");
		effMonthSelect.setSelectedAttribute(effMonth, true);
		HtmlSelect effYearSelect = page.getFirstByXPath("//select[@id='effYear']");
		effYearSelect.setSelectedAttribute(effYear, true);
		HtmlInput saveCodeInput = page.getFirstByXPath("//input[@id='saveCode']");
		saveCodeInput.setAttribute("value", saveCode);
		HtmlInput validateCodeInput = page.getFirstByXPath("//input[@id='validateCode']");
		validateCodeInput.setAttribute("value", validateCode);
		HtmlElement aButton = page.getFirstByXPath("//a[@id='savebutton']");
		page = clickHandler(aButton);
		try {
//			log.info("信用卡点击申请后的page==>" + page);
			Thread.sleep(500);
		} catch (InterruptedException e) {

			e.printStackTrace();
		}
		HtmlSpan noticeSpan = page.getFirstByXPath("//span[@id='notice']");
		HtmlSpan span_cCardNoSpan = page.getFirstByXPath("//span[@id='span_cCardNo']");
		if (noticeSpan.getAttribute("style").contains(" display: block;")) {
			returnValue.setState(CS.FAIL);
			returnValue.setMessage(noticeSpan.asText());
			log.info("noticeSpan.asText()===>"+noticeSpan.asText());
			return returnValue;
		} else if (span_cCardNoSpan.asText() != null) {
			returnValue.setState(CS.FAIL);
			returnValue.setMessage(span_cCardNoSpan.asText());
			log.info(span_cCardNoSpan.asText());
			return returnValue;
		}
		log.info("没发现问题!");
		returnValue.setState(CS.SUCCESS);
		return returnValue;
	}

	/**
	 * 特殊旅客出行提示
	 */
	@Override
	public Map<String, Object> specialpassenger() {
		Map<String, Object> map = new HashMap<String, Object>();
		specialpassengerPage = webClient.getCsairHtmlPage(Csair.URLSpecialPassenger, "URLSpecialPassenger", true);
		CS cs = loadPageHandler(specialpassengerPage, "//div[@class='form-con-list']");
		if (CS.SUCCESS == cs) {
			HtmlPage page = specialpassengerPage.getHtmlPage();
			specialpassengerPage.setLS(CS.SUCCESS);
			log.info("特殊旅客出行提示加载状态==>" + specialpassengerPage.getLS());
			String doc = page.getBody().getElementsByAttribute("div", "class", "form-con-list").get(0).asXml();
			map.put("doc", doc);
			return map;
		}
		specialpassengerPage.setLS(CS.FAIL);
		log.info("特殊旅客出行提示加载状态==>" + specialpassengerPage.getLS());
		return null;
	}

	/**
	 * 行动障碍旅客
	 */
	@Override
	public Map<String, Object> mobilitydisorders() {
		Map<String, Object> map = new HashMap<String, Object>();
		mobilitydisordersPage = webClient.getCsairHtmlPage(Csair.URLmobilitydisorders, "URLmobilitydisorders", true);
		CS cs = loadPageHandler(mobilitydisordersPage, "//div[@class='form-con-list']");
		if (CS.SUCCESS == cs) {
			HtmlPage page = mobilitydisordersPage.getHtmlPage();
			specialpassengerPage.setLS(CS.SUCCESS);
			log.info("特殊旅客出行提示加载状态==>" + mobilitydisordersPage.getLS());
			String doc = page.getBody().getElementsByAttribute("div", "class", "form-con-list").get(0).asXml();
			map.put("doc", doc);
			return map;
		}
		mobilitydisordersPage.setLS(CS.FAIL);
		log.info("特殊旅客出行提示加载状态==>" + mobilitydisordersPage.getLS());
		return null;
	}

	/**
	 * 视力或听力障碍旅客
	 */
	@Override
	public Map<String, Object> visionhearingimpairment() {
		Map<String, Object> map = new HashMap<String, Object>();
		visionhearingimpairmentPage = webClient.getCsairHtmlPage(Csair.URLvisionhearingimpairment,
				"URLvisionhearingimpairment", true);
		CS cs = loadPageHandler(visionhearingimpairmentPage, "//div[@class='form-con-list']");
		if (CS.SUCCESS == cs) {
			HtmlPage page = visionhearingimpairmentPage.getHtmlPage();
			specialpassengerPage.setLS(CS.SUCCESS);
			log.info("特殊旅客出行提示加载状态==>" + visionhearingimpairmentPage.getLS());
			String doc = page.getBody().getElementsByAttribute("div", "class", "form-con-list").get(0).asXml();
			map.put("doc", doc);
			return map;
		}
		visionhearingimpairmentPage.setLS(CS.FAIL);
		log.info("特殊旅客出行提示加载状态==>" + visionhearingimpairmentPage.getLS());
		return null;
	}
	
	/**
	 * 优惠券
	 */
	@Override
	public Map<String, Object> checkYHQ() {
		scl.URLYHQsy = null;
		Map<String, Object> map = new HashMap<String,Object>();
		checkYHQPage = webClient.getCsairHtmlPage(Csair.checkYHQ,"checkYHQ", false);
		HtmlPage page = checkYHQPage.getHtmlPage();
		for (int i = 0; i < timeoutmax; i++) {
			HtmlTableBody tbody1 = (HtmlTableBody) page.getElementById("couponList");
			if(tbody1 != null) {
				HtmlAnchor WSY = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "data-value", "1").get(0);
				HtmlAnchor YSY = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "data-value", "3").get(0);
				HtmlAnchor BSY = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "data-value", "n").get(0);
				map.put("wsy", WSY.asText());
				map.put("ysy", YSY.asText());
				map.put("bsy", BSY.asText());
				List<YHQ> YHQs = new ArrayList<YHQ>();
				clickHandler(WSY);
				for (int j = 0; j < timeoutmax; j++) {
					if(scl.URLYHQsy != null) {
						HtmlTableBody tbody = (HtmlTableBody) page.getElementById("couponList");
						DomNodeList<HtmlElement> trs = tbody.getElementsByTagName("tr");
						
						for (int k = 1; k < trs.size(); k++) {
							YHQ y = new YHQ();
							DomNodeList<HtmlElement> tds = trs.get(k).getElementsByTagName("td");
							int tdSize = tds.size();
							if(tdSize == 1) {
								y.setCode(tds.get(0).asText()); 
								YHQs.add(y);
							}else {
								y.setCode(tds.get(0).asText()); 
								y.setStatus(tds.get(1).asText());
								y.setMoney(tds.get(2).asText()); 
								y.setDate(tds.get(3).asText());
								y.setOrderDoc(tds.get(4).asText());
								HtmlDivision qtipDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "qtipdiv-wallt").get(0);
								Document qtipDivDoc = Jsoup.parse(qtipDiv.asXml());
								Element orderDoc = qtipDivDoc.select("div.qtipdiv-wallt").get(0);
								y.setOrder(orderDoc.toString()); 
								YHQs.add(y);
							}
							
						}
						map.put("YHQs", YHQs);
						map.put("mark", "wsy");
						break;
					}
					synchronized (page) {
						try {
							page.wait(200);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						log.info("ao文件加载中.....");
					}
				}
				break;
			}
			synchronized (page) {
				try {
					page.wait(1000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("页面加载中......");
			}
		}
		scl.URLYHQsy = null;	
		return map;
	}

	/**
	 * 点击优惠券未使用
	 */
	@Override
	public Map<String, Object> checkWSY() {
		Map<String, Object> map = new HashMap<String,Object>();
		HtmlPage page = checkYHQPage.getHtmlPage();
		HtmlAnchor WSY = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "data-value", "1").get(0);
		HtmlAnchor YSY = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "data-value", "3").get(0);
		HtmlAnchor BSY = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "data-value", "n").get(0);
		map.put("wsy", WSY.asText());
		map.put("ysy", YSY.asText());
		map.put("bsy", BSY.asText());
		List<YHQ> YHQs = new ArrayList<YHQ>();
		clickHandler(WSY);
		for (int j = 0; j < timeoutmax; j++) {
			if(scl.URLYHQsy != null) {
				HtmlTableBody tbody = (HtmlTableBody) page.getElementById("couponList");
				DomNodeList<HtmlElement> trs = tbody.getElementsByTagName("tr");
				
				for (int k = 1; k < trs.size(); k++) {
					YHQ y = new YHQ();
					DomNodeList<HtmlElement> tds = trs.get(k).getElementsByTagName("td");
					int tdSize = tds.size();
					if(tdSize == 0) {
						y.setCode("没有符合条件的优惠券！"); 
						YHQs.add(y);
					}else if(tdSize == 1) {
						y.setCode(tds.get(0).asText()); 
						YHQs.add(y);
					}else {
						y.setCode(tds.get(0).asText()); 
						y.setStatus(tds.get(1).asText());
						y.setMoney(tds.get(2).asText()); 
						y.setDate(tds.get(3).asText());
						y.setOrderDoc(tds.get(4).asText());
						HtmlDivision qtipDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "qtipdiv-wallt").get(0);
						Document qtipDivDoc = Jsoup.parse(qtipDiv.asXml());
						Element orderDoc = qtipDivDoc.select("div.qtipdiv-wallt").get(0);
						y.setOrder(orderDoc.toString()); 
						YHQs.add(y);
					}
					
				}
				map.put("YHQs", YHQs);
				map.put("mark", "wsy");
				break;
			}
			synchronized (page) {
				try {
					page.wait(200);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("ao文件加载中.....");
			}
		}
		scl.URLYHQsy = null;
		return map;
	}

	/**
	 * 点击优惠券已使用
	 */
	@Override
	public Map<String, Object> checkYSY() {
		Map<String, Object> map = new HashMap<String,Object>();
		HtmlPage page = checkYHQPage.getHtmlPage();
		HtmlAnchor WSY = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "data-value", "1").get(0);
		HtmlAnchor YSY = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "data-value", "3").get(0);
		HtmlAnchor BSY = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "data-value", "n").get(0);
		map.put("wsy", WSY.asText());
		map.put("ysy", YSY.asText());
		map.put("bsy", BSY.asText());
		List<YHQ> YHQs = new ArrayList<YHQ>();
		clickHandler(YSY);
		for (int j = 0; j < timeoutmax; j++) {
			if(scl.URLYHQsy != null) {
				HtmlTableBody tbody = (HtmlTableBody) page.getElementById("couponList");
				DomNodeList<HtmlElement> trs = tbody.getElementsByTagName("tr");
				
				for (int k = 1; k < trs.size(); k++) {
					YHQ y = new YHQ();
					DomNodeList<HtmlElement> tds = trs.get(k).getElementsByTagName("td");
					int tdSize = tds.size();
					if(tdSize == 0) {
						y.setCode("没有符合条件的优惠券！"); 
						YHQs.add(y);
					}else if(tdSize == 1) {
						y.setCode(tds.get(0).asText()); 
						YHQs.add(y);
					}else {
						y.setCode(tds.get(0).asText()); 
						y.setStatus(tds.get(1).asText());
						y.setMoney(tds.get(2).asText()); 
						y.setDate(tds.get(3).asText());
						y.setOrderDoc(tds.get(4).asText());
						HtmlDivision qtipDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "qtipdiv-wallt").get(0);
						Document qtipDivDoc = Jsoup.parse(qtipDiv.asXml());
						Element orderDoc = qtipDivDoc.select("div.qtipdiv-wallt").get(0);
						y.setOrder(orderDoc.toString()); 
						YHQs.add(y);
					}
					
				}
				map.put("YHQs", YHQs);
				map.put("mark", "ysy");
				break;
			}
			synchronized (page) {
				try {
					page.wait(200);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("ao文件加载中.....");
			}
		}
		scl.URLYHQsy = null;
		return map;
	}

	/**
	 * 点击优惠券不可使用
	 */
	@Override
	public Map<String, Object> checkBSY() {
		Map<String, Object> map = new HashMap<String,Object>();
		HtmlPage page = checkYHQPage.getHtmlPage();
		HtmlAnchor WSY = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "data-value", "1").get(0);
		HtmlAnchor YSY = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "data-value", "3").get(0);
		HtmlAnchor BSY = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "data-value", "n").get(0);
		map.put("wsy", WSY.asText());
		map.put("ysy", YSY.asText());
		map.put("bsy", BSY.asText());
		List<YHQ> YHQs = new ArrayList<YHQ>();
		clickHandler(BSY);
		for (int j = 0; j < timeoutmax; j++) {
			if(scl.URLYHQsy != null) {
				HtmlTableBody tbody = (HtmlTableBody) page.getElementById("couponList");
				DomNodeList<HtmlElement> trs = tbody.getElementsByTagName("tr");
				
				for (int k = 1; k < trs.size(); k++) {
					YHQ y = new YHQ();
					DomNodeList<HtmlElement> tds = trs.get(k).getElementsByTagName("td");
					int tdSize = tds.size();
					if(tdSize == 1) {
						y.setCode(tds.get(0).asText()); 
						YHQs.add(y);
					}else {
						y.setCode(tds.get(0).asText()); 
						y.setStatus(tds.get(1).asText());
						y.setMoney(tds.get(2).asText()); 
						y.setDate(tds.get(3).asText());
						y.setOrderDoc(tds.get(4).asText());
						HtmlDivision qtipDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "qtipdiv-wallt").get(0);
						Document qtipDivDoc = Jsoup.parse(qtipDiv.asXml());
						Element orderDoc = qtipDivDoc.select("div.qtipdiv-wallt").get(0);
						y.setOrder(orderDoc.toString()); 
						YHQs.add(y);
					}
					
				}
				map.put("YHQs", YHQs);
				map.put("mark", "bsy");
				break;
			}
			synchronized (page) {
				try {
					page.wait(200);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("ao文件加载中.....");
			}
		}
		scl.URLYHQsy = null;
		return map;
	}

	/**
	 * 查询优惠券号
	 */
	@Override
	public Map<String, Object> checkYHQNo(String keyword,String mark) {
		Map<String, Object> map = new HashMap<String,Object>();
		HtmlPage page = checkYHQPage.getHtmlPage();
		HtmlAnchor WSY = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "data-value", "1").get(0);
		HtmlAnchor YSY = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "data-value", "3").get(0);
		HtmlAnchor BSY = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "data-value", "n").get(0);
		map.put("wsy", WSY.asText());
		map.put("ysy", YSY.asText());
		map.put("bsy", BSY.asText());
		List<YHQ> YHQs = new ArrayList<YHQ>();
		HtmlInput keywordInput = (HtmlInput) page.getElementById("keyword");
		keywordInput.setValueAttribute(keyword);
		HtmlSpan couponSearchSpan = (HtmlSpan) page.getElementById("couponSearch");
		clickHandler(couponSearchSpan);
		for (int j = 0; j < timeoutmax; j++) {
			if(scl.URLYHQsy != null) {
				HtmlTableBody tbody = (HtmlTableBody) page.getElementById("couponList");
				DomNodeList<HtmlElement> trs = tbody.getElementsByTagName("tr");
				
				for (int k = 1; k < trs.size(); k++) {
					YHQ y = new YHQ();
					DomNodeList<HtmlElement> tds = trs.get(k).getElementsByTagName("td");
					int tdSize = tds.size();
					if(tdSize == 1) {
						y.setCode(tds.get(0).asText()); 
						YHQs.add(y);
					}else {
						y.setCode(tds.get(0).asText()); 
						y.setStatus(tds.get(1).asText());
						y.setMoney(tds.get(2).asText()); 
						y.setDate(tds.get(3).asText());
						y.setOrderDoc(tds.get(4).asText());
						HtmlDivision qtipDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "qtipdiv-wallt").get(0);
						Document qtipDivDoc = Jsoup.parse(qtipDiv.asXml());
						Element orderDoc = qtipDivDoc.select("div.qtipdiv-wallt").get(0);
						y.setOrder(orderDoc.toString()); 
						YHQs.add(y);
					}
				}
				map.put("YHQs", YHQs);
				map.put("mark", mark);
				break;
			}
			synchronized (page) {
				try {
					page.wait(200);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("ao文件加载中.....");
			}
		}
		scl.URLYHQsy = null;
		return map;
	}

	/**
	 * 绑定优惠券号
	 */
	@Override
	public Map<String, Object> checkBinding(String keyword) {
		alertMessage = null;
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = checkYHQPage.getHtmlPage();
		HtmlInput keywordInput = (HtmlInput) page.getElementById("keyword");
		keywordInput.setValueAttribute(keyword);
		HtmlSpan couponBindingSpan = (HtmlSpan) page.getElementById("couponBinding");
		clickHandler(couponBindingSpan);
		for (int j = 0; j < timeoutmax; j++) {
			if (alertMessage != null) {
				map.put("notice",alertMessage);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("等待提示框......");
			}
		}
		scl.URLYHQsy = null;	
		map.put("notice", "绑定超时！");
		return map;
	}

	/**
	 * 里程汇总
	 */
	@Override
	public Map<String, Object> checkLCHZ() {
		Map<String, Object> map = new HashMap<String,Object>();
		checkLCHZ = webClient.getCsairHtmlPage(Csair.URLMileagetotal,"URLMileagetotal", false);
		List<MyLCTd> myLCTdList = new ArrayList<MyLCTd>();
		List<OneYearLcMx> oneYearLcMxList = new ArrayList<OneYearLcMx>();
		HtmlPage page = checkLCHZ.getHtmlPage();
		
//		log.info(page.asXml());
		for (int i = 0; i < timeoutmax; i++) {
			List<HtmlElement> table1s = page.getBody().getElementsByAttribute("table", "class", "user-cox-list1");
			if(scl.URLMileagetotalPage != null && table1s.size() != 0) {
				HtmlTable table = (HtmlTable) page.getBody().getElementsByAttribute("table", "class", "new_table").get(0);
				DomNodeList<HtmlElement> trs = table.getElementsByTagName("tr");
				for (int j = 0; j < trs.size(); j++) {
					MyLCTd myLCTd = new MyLCTd();
					HtmlElement tr = trs.get(j);
					DomNodeList<HtmlElement> tds = tr.getElementsByTagName("td");
					myLCTd.setTd0(tds.get(0).asText()); 
					myLCTd.setTd1(tds.get(1).asText());
					myLCTd.setTd2(tds.get(2).asText()); 
					myLCTd.setTd3(tds.get(3).asText()); 
					myLCTdList.add(myLCTd);
				}
				map.put("myLCTdList", myLCTdList);
				
				HtmlTable table1 = (HtmlTable) table1s.get(0);
				DomNodeList<HtmlElement> tr1s = table1.getElementsByTagName("tr");
				for (int j = 1; j < tr1s.size(); j++) {
					OneYearLcMx oneYearLcMx = new OneYearLcMx();
					HtmlElement tr1 = tr1s.get(j);
					DomNodeList<HtmlElement> td1s = tr1.getElementsByTagName("td");
					oneYearLcMx.setDqrq(td1s.get(0).asText());
					oneYearLcMx.setBydqLc(td1s.get(1).asText());
					oneYearLcMx.setJzbydqLc(td1s.get(2).asText());
					oneYearLcMx.setRzrq(td1s.get(3).asText());
					oneYearLcMx.setGqLc(td1s.get(4).asText());
					oneYearLcMx.setMgqyy(td1s.get(5).asText());
					oneYearLcMxList.add(oneYearLcMx);
				}
				map.put("oneYearLcMxList", oneYearLcMxList);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("页面加载中......");
			}
		}
		return map;
	}
	
	/**
	 * 城市间里程累计查询加载
	 */
	@Override
	public CsairReturnValue checklCLj() {
		scl.lcljcxymjz = null;
		CsairReturnValue returnValue = new CsairReturnValue();
		checkCitiesLCLj = webClient.getCsairHtmlPage(Csair.URLCitiesLCLjPage,"URLCitiesLCLjPage", false);
		HtmlPage page = checkCitiesLCLj.getHtmlPage();
		for (int i = 0; i < timeoutmax; i++) {
			HtmlInput cname_city1Input = (HtmlInput) page.getElementById("cname_city1");
			if(cname_city1Input != null && scl.lcljcxymjz != null) {
				returnValue.setState(CS.SUCCESS);
				page.executeJavaScript("window.stop();");
				return returnValue;
			}
			synchronized (page) {
				try {
					page.wait(3000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("正在加载页面.....");
			}
		}
		returnValue.setState(CS.FAIL);
		return returnValue;
	}
	
	/**
	 * 城市间累计里程查询
	 */
	@Override
	public Map<String, Object> cityLCcheck(String cname_city1, String cname_city2 ,String select) {
		log.info("cname_city1==>"+cname_city1);
		scl.URLCityLCLjMX = null;
		alertMessage = null;
		Map<String, Object> map = new HashMap<String, Object>();
		List<CityLCLjInfo> cityLCLjInfoList = new ArrayList<CityLCLjInfo>();
		HtmlPage page = checkCitiesLCLj.getHtmlPage();
//		page.executeJavaScript("window.stop();");
		StringBuilder js = new StringBuilder();
		StringBuilder js2 = new StringBuilder();
		StringBuilder js3 = new StringBuilder();
        js.append("$('#city1').attr('value','").append(cname_city1).append("');");  
        page.executeJavaScript(js.toString());
		js2.append("$('#city2').attr('value','").append(cname_city2).append("');");  
		page.executeJavaScript(js2.toString());
		js3.append("$('#select').attr('value','").append(select).append("');");  
		page.executeJavaScript(js3.toString());

		
		page.executeJavaScript("var queryString = $('#searchForm').serialize();");
		String str = "$.post('/skypearl/cn/searchAccumulate.action', queryString, function(data) {	$('.searchOk').css('display','block');$('.searchBut').attr('disabled',false);$('#loadimg').css('display','none');$('.searchOk').html(data);});";
	
		ScriptResult result = page.executeJavaScript(str);
		page = (HtmlPage) result.getJavaScriptResult();
		for (int i = 0; i < timeoutmax; i++) {
			if(scl.URLCityLCLjMX != null) {
				if(alertMessage != null) {
					map.put("alertMessage", alertMessage);
					return map;
				}
				HtmlDivision searchOkContent = (HtmlDivision) page.getElementById("searchOkContent");
				if(searchOkContent != null) {
					HtmlTable tb1 = (HtmlTable) searchOkContent.getElementsByTagName("table").get(0);
					HtmlTableRow tr1 = (HtmlTableRow) tb1.getElementsByTagName("tr").get(1);
					String td1Text = tr1.getElementsByTagName("td").get(0).asText();
					String td2Text = tr1.getElementsByTagName("td").get(1).asText();
					map.put("bz_HangDuan", td1Text);
					map.put("bz_BiaoZhunLiCheng", td2Text);
					
					HtmlTable tb2 = (HtmlTable) searchOkContent.getElementsByTagName("table").get(1);
					DomNodeList<HtmlElement> trs = tb2.getElementsByTagName("tr");
					for (int j = 1; j < trs.size(); j++) {
						CityLCLjInfo cityLcInfo = new CityLCLjInfo();
						HtmlElement tr = trs.get(j);
						DomNodeList<HtmlElement> tds = tr.getElementsByTagName("td");
						cityLcInfo.setHangDuan(tds.get(0).asText());
						cityLcInfo.setCangWei(tds.get(1).asText());
						cityLcInfo.setJiBenFeiXingLiCheng(tds.get(2).asText());
						cityLcInfo.setShengJiLiCheng(tds.get(3).asText());
						cityLcInfo.setShengJiHangDuan(tds.get(4).asText());
						cityLCLjInfoList.add(cityLcInfo);
					}
					map.put("cityLCLjInfoList", cityLCLjInfoList);
					return map;
				}
			}
			synchronized (page) {
				try {
					page.wait(1000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("正在加载页面.....");
			}
		}
		return map;
	}
	
	/**
	 * 里程兑换计算器加载
	 */
	@Override
	public CsairReturnValue jzExchange() {
		CsairReturnValue returnValue = new CsairReturnValue();
		checkLcExchange = webClient.getCsairHtmlPage(Csair.URLLCExchangePage,"URLLCExchangePage", false);
		HtmlPage page = checkLcExchange.getHtmlPage();
		for (int i = 0; i < timeoutmax; i++) {
			HtmlInput cname_city1Input = (HtmlInput) page.getElementById("cname_city1");
			if(cname_city1Input != null && scl.lcljcxymjz != null) {
				returnValue.setState(CS.SUCCESS);
				return returnValue;
			}
			synchronized (page) {
				try {
					page.wait(3000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("正在加载页面.....");
			}
		}
		returnValue.setState(CS.FAIL);
		return returnValue;
	}
	
	/**
	 * 里程兑换计算器查询
	 */
	@Override
	public Map<String, Object> LcExchangeCheck(String cname_city1, String cname_city2) {
		scl.URLLCExchangeMX = null;
		alertMessage = null;
		Map<String, Object> map = new HashMap<String, Object>();
		List<LcExchangeInfo> LcExchangeInfoList = new ArrayList<LcExchangeInfo>();
		HtmlPage page = checkLcExchange.getHtmlPage();
//		HtmlInput cname_city1Input = (HtmlInput) page.getElementById("cname_city1");
//		cname_city1Input.focus();
//		cname_city1Input.setValueAttribute(cname_city1);
//		cname_city1Input.blur();
//		HtmlInput cname_city2Input = (HtmlInput) page.getElementById("cname_city2");
//		cname_city2Input.focus();
//		cname_city2Input.setValueAttribute(cname_city2);
//		cname_city2Input.blur();
//		HtmlAnchor searchBut = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "class", "lmsearchmn searchBut").get(0);
		StringBuilder js = new StringBuilder();
		StringBuilder js2 = new StringBuilder();
        js.append("$('#city1').attr('value','").append(cname_city1).append("');");  
		page.executeJavaScript(js.toString());
		
		js2.append("$('#city2').attr('value','").append(cname_city2).append("');");  
		page.executeJavaScript(js2.toString());
		
		page.executeJavaScript("loadflish();");
		page.executeJavaScript("$('#msg').html('');");
		page.executeJavaScript("var queryString = $('#searchForm').serialize();");

		String str = "$.post('/skypearl/cn/searchExchange.action', queryString, function(data) {$('.searchOk').css('display','block');$('.searchBut').attr('disabled',false);$('.searchOk').html(data);});";
		ScriptResult result = page.executeJavaScript(str);
		page = (HtmlPage) result.getJavaScriptResult();
		
		for (int i = 0; i < timeoutmax; i++) {
			if(scl.URLLCExchangeMX != null) {
				if(alertMessage != null) {
					map.put("alertMessage", alertMessage);
					return map;
				}
				HtmlDivision searchOkContent = (HtmlDivision) page.getElementById("searchOkContent");
				if(searchOkContent != null) {
					HtmlTable tb1 = (HtmlTable) searchOkContent.getElementsByTagName("table").get(0);
					HtmlTableRow tr1 = (HtmlTableRow) tb1.getElementsByTagName("tr").get(1);
					String td1Text = tr1.getElementsByTagName("td").get(0).asText();
					String td2Text = tr1.getElementsByTagName("td").get(1).asText();
					String td3Text = tr1.getElementsByTagName("td").get(2).asText();
					String td4Text = tr1.getElementsByTagName("td").get(3).asText();
					String td5Text = tr1.getElementsByTagName("td").get(4).asText();
					map.put("bz_HangDuan", td1Text);
					map.put("bz_JingJiCang", td2Text);
					map.put("bz_MingZhuJingJiCang", td3Text);
					map.put("bz_GongWuCang", td4Text);
					map.put("bz_TouDengCang", td5Text);
					
					HtmlTable tb2 = (HtmlTable) searchOkContent.getElementsByTagName("table").get(1);
					DomNodeList<HtmlElement> trs = tb2.getElementsByTagName("tr");
					for (int j = 2; j < trs.size(); j++) {
						LcExchangeInfo lcExchangeInfo = new LcExchangeInfo();
						HtmlElement tr = trs.get(j);
						DomNodeList<HtmlElement> tds = tr.getElementsByTagName("td");
						lcExchangeInfo.setCangWei(tds.get(0).asText());
						lcExchangeInfo.setMingZhuJingJiCang(tds.get(1).asText());
						lcExchangeInfo.setGongWuCang(tds.get(2).asText());
						lcExchangeInfo.setTouDengCang(tds.get(3).asText());
						LcExchangeInfoList.add(lcExchangeInfo);
					}
					map.put("LcExchangeInfoList", LcExchangeInfoList);
					return map;
				}
			}
			synchronized (page) {
				try {
					page.wait(200);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("里程兑换计算中.....");
			}
		}
		return map;
	}
	
	/**
	 * 查询余额
	 */
	@Override
	public Map<String, Object> checkBalance() {
		Map<String, Object> map = new HashMap<String,Object>();
		checkBalancePage = webClient.getCsairHtmlPage(Csair.checkBalance,"checkBalance", false);
		HtmlPage page = checkBalancePage.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision for_registerDiv = (HtmlDivision) page.getElementById("for_register");
			HtmlSpan accountIDSpan = (HtmlSpan) page.getElementById("accountID");
			if(for_registerDiv != null) {
				map.put("mark", "register");
				return map;
			}
			if(accountIDSpan != null) {
				for (int j = 0; j < timeoutmax; j++) {
					if(scl.URLyexianshi != null) {
						String accountID = accountIDSpan.asText();
						map.put("accountID",accountID);
						
						HtmlSpan statusStrSpan = (HtmlSpan) page.getElementById("statusStr");
						String statusStr = statusStrSpan.asText();
						map.put("statusStr", statusStr);
						
						HtmlSpan balanceNumSpan = (HtmlSpan) page.getElementById("balanceNum");
						String balanceNum = balanceNumSpan.asText();
						map.put("balanceNum", balanceNum);
						
						HtmlSpan unvalueNumSpan = (HtmlSpan) page.getElementById("unvalueNum");
						String unvalueNum = unvalueNumSpan.asText();
						map.put("unvalueNum", unvalueNum);
						
						HtmlSpan valueNumSpan = (HtmlSpan) page.getElementById("valueNum");
						String valueNum = valueNumSpan.asText();
						map.put("valueNum", valueNum);
						
						map.put("mark", "yuE");
						
						scl.URLyexianshi = null;
						return map;
					}
					synchronized (page) {
						try {
							page.wait(200);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						log.info("ao文件加载中.....");
					}
				}
			}
			synchronized (page) {
				try {
					page.wait(1000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("页面加载中......");
			}
		}
		map.put("mark", "null");
		return map;
	}
	
	/**
	 * 立即开通
	 */
	@Override
	public Map<String, Object> ljkt() {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = checkBalancePage.getHtmlPage();
		clickHandler(page.getElementById("for_register"));
		for (int i = 0; i < timeoutmax; i++) {
			List<HtmlElement> elements = page.getBody().getElementsByAttribute("input", "name", "userName");
			if(elements != null) {
				HtmlInput userNameInput = (HtmlInput) elements.get(0);
				String userName = userNameInput.getAttribute("value");
				map.put("userName", userName);
				HtmlInput cardNoInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "name", "cardNo").get(0);
				String cardNo = cardNoInput.getAttribute("value");
				map.put("cardNo", cardNo);
				HtmlInput idTypeTextInput = (HtmlInput) page.getElementById("idTypeText");
				String idTypeText = idTypeTextInput.getAttribute("value");
				map.put("idTypeText", idTypeText);
				HtmlInput idNumberInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "name", "idNumber").get(0);
				String idNumber = idNumberInput.getAttribute("value");
				map.put("idNumber", idNumber);
//				HtmlInput mobileInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "name", "mobile").get(0);
//				String mobile = mobileInput.getAttribute("value");
//				map.put("mobile", mobile);
//				HtmlInput emailInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "name", "email").get(0);
//				String email = emailInput.getAttribute("value");
//				map.put("email", email);
//				HtmlInput questionInput = (HtmlInput) page.getElementById("question");
//				String question = questionInput.getAttribute("value");
//				map.put("question", question);
				map.put("notice", "success");
				return map;
			}
			synchronized (page) {
				try {
					page.wait(200);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				log.info("开通页面加载中.....");
			}
		}
		map.put("notice", "false");
		return map;
	}

	/**
	 * 余额点击获取验证码
	 */
	@Override
	public Map<String, Object> sjyzm(String mobile) {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = checkBalancePage.getHtmlPage();
		HtmlInput mobileInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "name", "mobile").get(0);
		mobileInput.setValueAttribute(mobile);
		
		try {
			page.getBody().getElementsByAttribute("input", "class", "vcode-btn btn").get(0).click();
		} catch (IOException e) {
			e.printStackTrace();
		}
		for (int j = 0; j < timeoutmax; j++) {
			if(scl.URLyecode != null) {
				HtmlDivision alert_msg_box = (HtmlDivision) page.getElementById("alert_msg_box");
				if(alert_msg_box != null) {
					String style = alert_msg_box.getAttribute("style");
					if(!style.contains("none")) {
						log.info("出现对话框！");
						Document doc = Jsoup.parse(alert_msg_box.asXml());
						String notice = doc.select(".confirm-window .confirm-info p").get(0).text();
						map.put("notice", notice);
						scl.URLyecode = null;
						HtmlButton button = (HtmlButton) page.getBody().getElementsByAttribute("button", "class", "btn btn-primary").get(0);
						clickHandler(button);
						return map;
					}
				}
				
			}
			synchronized (page) {
				try {
					page.wait(1000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("ao文件加载中......");
			}
		}
		map.put("notice", "验证码获取失败！");
		return map;
			
	}
	
	/**
	 * 完成注册
	 */
	@Override
	public Map<String, Object> wczc(YuEZhuCeInfo yuEZhuCeInfo) {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = checkBalancePage.getHtmlPage();
		HtmlInput mobileInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "name", "mobile").get(0);
		mobileInput.setValueAttribute(yuEZhuCeInfo.getMobile());
//		HtmlInput emailInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "name", "email").get(0);
//		emailInput.setValueAttribute(yuEZhuCeInfo.getEmail());
		
//		HtmlDivision select = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "select-ico").get(0);
//		clickHandler(select);
//		HtmlUnorderedList ul = (HtmlUnorderedList) page.getElementById("question_ul");
//		String style = ul.getAttribute("style");
//		log.info("style=====>"+style);
//		if (ul.getAttribute("style").contains("block")) {
//			DomNodeList<DomNode> options = ul.getChildNodes();
//			for (int i = 0; i < options.size(); i++) {
//				HtmlListItem option = (HtmlListItem) options.get(i);
//				if(option.asText().equals(yuEZhuCeInfo.getQuestion())) {
//					clickHandler(option);
//				}
//			}
//			String style1 = ul.getAttribute("style");
//			String newStyle1 = style1.replace("block", "none");
//			ul.setAttribute("style", newStyle1);
//		}else if(ul.getAttribute("style").contains("none")) {
//			String style1 = ul.getAttribute("style");
//			String newStyle = style1.replace("none", "block");
//			ul.setAttribute("style", newStyle);
//			DomNodeList<DomNode> options = ul.getChildNodes();
//			for (int i = 0; i < options.size(); i++) {
//				HtmlListItem option = (HtmlListItem) options.get(i);
//				if(option.asText().equals(yuEZhuCeInfo.getQuestion())) {
//					clickHandler(option);
//				}
//			}
//			String style2 = ul.getAttribute("style");
//			String newStyle2 = style2.replace("block", "none");
//			ul.setAttribute("style", newStyle2);
//		}
//		String value = page.getElementById("question").getAttribute("value");
//		log.info("question=====>"+value);
		HtmlInput pwdInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "name", "pwd").get(0);
		pwdInput.setValueAttribute(yuEZhuCeInfo.getPwd());
		HtmlInput passwordAgainInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "name", "passwordAgain").get(0);
		passwordAgainInput.setValueAttribute(yuEZhuCeInfo.getPasswordAgain());
//		HtmlInput answerInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "name", "answer").get(0);
//		answerInput.setValueAttribute(yuEZhuCeInfo.getAnswer());
		HtmlInput codeInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "name", "code").get(0);
		codeInput.setValueAttribute(yuEZhuCeInfo.getCode());
		HtmlInput checkboxInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "class", "read-checkbox").get(0);
		clickHandler(checkboxInput);
		HtmlInput registerInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "value", "完成注册").get(0);
		clickHandler(registerInput);
		
		for (int i = 0; i < timeoutmax; i++) {
			log.info("scl.URLyeregister====>"+scl.URLyeregister);
			if(scl.URLyeregister != null) {
				try {
					Thread.sleep(1000);
				} catch (InterruptedException e1) {
					e1.printStackTrace();
				}
				HtmlDivision alert_msg_box = (HtmlDivision) page.getElementById("alert_msg_box");
				HtmlDivision successConfirmDiv = (HtmlDivision) page.getElementById("successConfirm");
				if(successConfirmDiv != null) {
					map.put("notice", "恭喜您，您的电子钱包已激活！");
					map.put("status", "true");
					scl.URLyeregister = null;
					clickHandler(successConfirmDiv);
					return map;
				}
				if(alert_msg_box != null) {
					Document doc = Jsoup.parse(alert_msg_box.asXml());
					String notice = doc.select(".confirm-window .confirm-info p").get(0).text();
					HtmlButton btn1 = (HtmlButton) page.getBody().getElementsByAttribute("button", "class", "btn btn-primary").get(0);
					clickHandler(btn1);
					map.put("notice", notice);
					map.put("status", "false");
					scl.URLyeregister = null;
					return map;
				}
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("ao文件加载中......");
			}
		}
		map.put("notice", "注册失败！");
		map.put("status", "false");
		return map;
	}
	
	/**
	 * 点击充值
	 */
//	@Override
//	public Map<String, Object> checkChongzhi() {
//		Map<String, Object> map = new HashMap<String,Object>();
//		HtmlPage page = checkBalancePage.getHtmlPage();
//		HtmlAnchor recharge_btn = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "class", "recharge-btn").get(0);
//		try {
//			recharge_btn.click();
//		} catch (IOException e) {
//			e.printStackTrace();
//		}
//		for (int i = 0; i < timeoutmax; i++) {
//			HtmlSelect paytypeSelect = (HtmlSelect) page.getElementById("paytype");
//			if(paytypeSelect != null) {
//				HtmlInput nameInput = (HtmlInput) page.getElementById("name");
//				String name = nameInput.getAttribute("value");
//				map.put("name", name);
//				HtmlInput accountInput = (HtmlInput) page.getElementById("account");
//				String account = accountInput.getAttribute("value");
//				map.put("account", account);
//				break;
//			}
//			synchronized (page) {
//				try {
//					page.wait(500);
//				} catch (InterruptedException e) {
//					e.printStackTrace();
//				}
//				log.info("正在加载页面.......");
//			}
//		}
//		return map;
//	}
	
	/**
	 * chinapay点击下一步
	 */
//	@Override
//	public Map<String, Object> chinapayNext(String paytype, String chinapaymoney, String id) {
//		Map<String, Object> map = new HashMap<String, Object>();
//		HtmlPage page = checkBalancePage.getHtmlPage();
//		HtmlSelect paytypeSelect = (HtmlSelect) page.getElementById("paytype");
//		HtmlOption paytypeOption = paytypeSelect.getOptionByValue(paytype);
//		paytypeOption.setSelected(true);
//		
//		HtmlInput chinapaymoneyInput = (HtmlInput) page.getElementById("chinapaymoney");
//		chinapaymoneyInput.setValueAttribute(chinapaymoney);
//		
//		HtmlInput bankInput = (HtmlInput) page.getElementById(id);
//		try {
//			bankInput.click();
//		} catch (IOException e) {
//			e.printStackTrace();
//		}
//		
//		HtmlSpan chinapay_nextSpan = (HtmlSpan) page.getElementById("chinapay_next");
//		try {
//			chinapay_nextSpan.click();
//		} catch (IOException e) {
//			e.printStackTrace();
//		}
//		return map;
//	}
//	
	/**
	 * 充值卡充值点击下一步
	 */
//	@Override
//	public Map<String, Object> rechargeableNext(String paytype, String cardaccount, String cardpassword) {
//		Map<String, Object> map = new HashMap<String, Object>();
//		HtmlPage page = checkBalancePage.getHtmlPage();
//		HtmlSelect paytypeSelect = (HtmlSelect) page.getElementById("paytype");
//		HtmlOption paytypeOption = paytypeSelect.getOptionByValue(paytype);
//		paytypeOption.setSelected(true);
//		
//		HtmlInput cardaccountInput = (HtmlInput) page.getElementById("cardaccount");
//		cardaccountInput.setValueAttribute(cardaccount);
//		HtmlInput cardpasswordInput = (HtmlInput) page.getElementById("cardpassword");
//		cardpasswordInput.setValueAttribute(cardpassword);
//		HtmlSpan card_nextSpan = (HtmlSpan) page.getElementById("card_next");
//		try {
//			card_nextSpan.click();
//		} catch (IOException e) {
//			e.printStackTrace();
//		}
//		return map;
//	}
	
	/**
	 * 航班动态按照出发、到达城市查询
	 */
	@Override
	public Map<String, Object> flightDynamicsPlace(String c1, String c2, String date, int year, int month, int day) {
		Map<String, Object> map = new HashMap<String, Object>();
		List<FlightDynamics> flightDynamicsList = new ArrayList<FlightDynamics>();
		URLflightDynamicsPlace = Csair.URLflightDynamics+"?c1="+c1+"&c2="+c2+"&d="+date+"&s=1";
		flightDynamicsPlacePage = webClient.getCsairHtmlPage(URLflightDynamicsPlace, "URLflightDynamicsPlace", false);

		HtmlPage page = flightDynamicsPlacePage.getHtmlPage();
		for (int i = 0; i < timeoutmax; i++) {
				
				HtmlDivision alert_msg_box = (HtmlDivision) page.getElementById("alert_msg_box");
				if(alert_msg_box != null) {
					String style = alert_msg_box.getAttribute("style");
					if(!style.contains("none")) {
						HtmlDivision confirm_window = (HtmlDivision) alert_msg_box.getElementsByAttribute("div", "class", "confirm-window").get(0);
						String errorinfo = confirm_window.getElementsByTagName("p").get(0).asText();
						map.put("errorAlert", errorinfo);
						map.put("mark", "place");
						return map;
					}
				}
				
				List<HtmlElement> alert_infoDiv = page.getBody().getElementsByAttribute("div", "class", "alert-info");
				if(alert_infoDiv.size() != 0) {
					String alert_infoDivText = alert_infoDiv.get(0).asText();
					map.put("noflight", alert_infoDivText);
					map.put("mark", "place");
					return map;
				}
				HtmlUnorderedList flightListUl = (HtmlUnorderedList) page.getElementById("flightList");
				if(flightListUl != null) {
					HtmlDivision mainContentDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flt-mainContent").get(0);
					Document doc = Jsoup.parse(mainContentDiv.asXml());
					String place = doc.select(".title h1").get(0).text();
					map.put("place", place);
					
					flightListUl = (HtmlUnorderedList) page.getElementById("flightList");
					Iterable<DomElement> lis = flightListUl.getChildElements();
					for (DomElement domElement : lis) {
						HtmlElement li = (HtmlElement) domElement;
						FlightDynamics flightDynamics = new FlightDynamics();
						DomNodeList<HtmlElement> uls = li.getElementsByTagName("ul");
						
						if(uls.size() == 0) {
							Document liDoc = Jsoup.parse(li.asXml());
							String fl_info = liDoc.select(".num").get(0).text();
							flightDynamics.setFl_info(fl_info);
							String fl_dcity = liDoc.select(".dAirport").get(0).text();
							flightDynamics.setFl_dcity(fl_dcity);
							String fl_acity = liDoc.select(".aAirport").get(0).text();
							flightDynamics.setFl_acity(fl_acity);
							
							int fl_dtime11Size = liDoc.select(".depTime .time1").size();
							if(fl_dtime11Size > 0) {
								String fl_dtime11 = liDoc.select(".depTime .time1 .bold").get(0).text();
								flightDynamics.setFl_dtime11(fl_dtime11);
								String fl_dstatus11 = liDoc.select(".depTime .time1 .status").get(0).text();
								log.info("if fl_dstatus11====>"+fl_dstatus11);
								flightDynamics.setFl_dstatus11(fl_dstatus11);
								String fl_dtime12 = liDoc.select(".depTime .time2").get(0).text();
								flightDynamics.setFl_dtime12(fl_dtime12);
							}else {
								String fl_dtime12 = liDoc.select(".depTime").get(0).ownText();
								flightDynamics.setFl_dtime12(fl_dtime12);
							}
							
							int fl_arrtime11Size = liDoc.select(".arrTime .time1").size();
							if(fl_arrtime11Size > 0) {
								String fl_atime11 = liDoc.select(".arrTime .time1 .bold").get(0).text();
								flightDynamics.setFl_atime11(fl_atime11);
								String fl_astatus11 = liDoc.select(".arrTime .time1 .status").get(0).text();
								log.info("if fl_astatus11====>"+fl_astatus11);
								flightDynamics.setFl_astatus11(fl_astatus11);
								String fl_atime12 = liDoc.select(".arrTime .time2").get(0).text();
								flightDynamics.setFl_atime12(fl_atime12);
							}else {
								String fl_atime12 = liDoc.select(".arrTime").get(0).ownText();
								flightDynamics.setFl_atime12(fl_atime12);
							}
							
							String fl_status = liDoc.select(".status .status-logo").text();
							flightDynamics.setFl_status1(fl_status);
							flightDynamics.setFl_count("1");
							flightDynamicsList.add(flightDynamics);
						}else {
							HtmlUnorderedList ul1 = (HtmlUnorderedList) uls.get(0);
							DomNodeList<HtmlElement> ullis = ul1.getElementsByTagName("li");
							HtmlElement ulli1 = ullis.get(0);
							Document ulli1Doc = Jsoup.parse(ulli1.asXml());
							String fl_info = ulli1Doc.select(".num").get(0).ownText();
							flightDynamics.setFl_info(fl_info);
							String fl_dcity = ulli1Doc.select(".dAirport").get(0).ownText();
							flightDynamics.setFl_dcity(fl_dcity);
							String fl_acity = ulli1Doc.select(".aAirport").get(0).ownText();
							flightDynamics.setFl_acity(fl_acity);
							int fl_dtime11Size = ulli1Doc.select(".depTime .time1").size();
							if(fl_dtime11Size > 0) {
								String fl_dtime11 = ulli1Doc.select(".depTime .time1 .bold").get(0).text();
								flightDynamics.setFl_dtime11(fl_dtime11);
								String fl_dstatus11 = ulli1Doc.select(".depTime .time1 .status").get(0).text();
								log.info("else fl_dstatus11====>"+fl_dstatus11);
								flightDynamics.setFl_dstatus11(fl_dstatus11);
								String fl_dtime12 = ulli1Doc.select(".depTime .time2").get(0).text();
								flightDynamics.setFl_dtime12(fl_dtime12);
							}else {
								String fl_dtime12 = ulli1Doc.select(".depTime").get(0).ownText();
								flightDynamics.setFl_dtime12(fl_dtime12);
							}
							
							int fl_arrtime11Size = ulli1Doc.select(".arrTime .time1").size();
							if(fl_arrtime11Size > 0) {
								String fl_atime11 = ulli1Doc.select(".arrTime .time1 .bold").get(0).text();
								flightDynamics.setFl_atime11(fl_atime11);
								String fl_astatus11 = ulli1Doc.select(".arrTime .time1 .status").get(0).text();
								log.info("else fl_astatus11===>"+fl_astatus11);
								flightDynamics.setFl_astatus11(fl_astatus11);
								String fl_atime12 = ulli1Doc.select(".arrTime .time2").get(0).text();
								flightDynamics.setFl_atime12(fl_atime12);
							}else {
								String fl_atime12 = ulli1Doc.select(".arrTime").get(0).ownText();
								flightDynamics.setFl_atime12(fl_atime12);
							}
							
							String fl_jingTing1 = ulli1Doc.select(".transfer-time .content span").get(0).text();
							String fl_jingTing2 = ulli1Doc.select(".transfer-time .content span").get(1).text();
							flightDynamics.setFl_jingTing(fl_jingTing1+" "+fl_jingTing2);
							String fl_status1 = ulli1.getElementsByAttribute("div", "class", "status-logo").get(0).asText();
							flightDynamics.setFl_status1(fl_status1);
							
							HtmlElement ulli3 = ullis.get(1);
							Document ulli3Doc = Jsoup.parse(ulli3.asXml());
							String fl_info2 = ulli3Doc.select(".num").get(0).ownText();
							flightDynamics.setFl_info2(fl_info2);
							String fl_dcity2 = ulli3Doc.select(".dAirport").get(0).ownText();
							flightDynamics.setFl_dcity2(fl_dcity2);
							String fl_acity2 = ulli3Doc.select(".aAirport").get(0).ownText();
							flightDynamics.setFl_acity2(fl_acity2);
							int fl_dtime21Size = ulli3Doc.select(".depTime .time1").size();
							if(fl_dtime21Size > 0) {
								String fl_dtime21 = ulli3Doc.select(".depTime .time1 .bold").get(0).text();
								flightDynamics.setFl_dtime21(fl_dtime21);
								String fl_dstatus21 = ulli3Doc.select(".depTime .time1 .status").get(0).text();
								flightDynamics.setFl_dstatus21(fl_dstatus21);
								String fl_dtime22 = ulli3Doc.select(".depTime .time2").get(0).text();
								flightDynamics.setFl_dtime22(fl_dtime22);
							}else {
								String fl_dtime22 = ulli3Doc.select(".depTime").get(0).ownText();
								flightDynamics.setFl_dtime22(fl_dtime22);
							}
							
							int fl_arrtime21Size = ulli3Doc.select(".arrTime .time1").size();
							if(fl_arrtime21Size > 0) {
								String fl_atime21 = ulli3Doc.select(".arrTime .time1 .bold").get(0).text();
								flightDynamics.setFl_atime21(fl_atime21);
								String fl_astatus21 = ulli3Doc.select(".arrTime .time1 .status").get(0).text();
								flightDynamics.setFl_astatus21(fl_astatus21);
								String fl_atime22 = ulli3Doc.select(".arrTime .time2").get(0).text();
								flightDynamics.setFl_atime22(fl_atime22);
							}else {
								String fl_atime22 = ulli3Doc.select(".arrTime").get(0).ownText();
								flightDynamics.setFl_atime22(fl_atime22);
							}
							String fl_status2 = ulli3.getElementsByAttribute("div", "class", "status-logo").get(0).asText();
							flightDynamics.setFl_status2(fl_status2);
							flightDynamics.setFl_count("2");//用于记录该条信息的行数（是否有经停，经停为2）
							flightDynamicsList.add(flightDynamics);
						}
					}
					map.put("flightDynamicsList", flightDynamicsList);
					int nian2 = 0;int yue2 = 0;int ri2 = 0;
					if(month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 ) {
						if(day == 31) {
							nian2 = year;
							yue2 = month+1;
							ri2 = 1;
						}else {
							nian2 = year;
							yue2 = month;
							ri2 = day+1;
						}
					}else if(month == 4 || month == 6 || month == 9 || month == 11) {
						if(day == 30) {
							nian2 = year;
							yue2 = month+1;
							ri2 = 1;
						}else {
							nian2 = year;
							yue2 = month;
							ri2 = day+1;
						}
					}else if(year%4 != 0 && month == 2) {
						if(day == 28) {
							nian2 = year;
							yue2 = month+1;
							ri2 = 1;
						}else {
							nian2 = year;
							yue2 = month;
							ri2 = day+1;
						}
					}else if(year%4 == 0 && month == 2) {
						if(day == 29) {
							nian2 = year;
							yue2 = month+1;
							ri2 = 1;
						}else {
							nian2 = year;
							yue2 = month;
							ri2 = day+1;
						}
					}else if(month == 12) {
						if(day == 31) {
							nian2 = year + 1;
							yue2 = 1;
							ri2 = 1;
						}else {
							nian2 = year;
							yue2 = month;
							ri2 = day+1;
						}
					}
					String year1 = String.valueOf(year);
					String year2 = String.valueOf(nian2);
					String month1 = null;
					String month2 = null;
					String day1 = null;
					String day2 = null;
					if(month < 10) {
						month1 = "0"+String.valueOf(month);
					}else {
						month1 = String.valueOf(month);
					}
					if(yue2 < 10) {
						month2 = "0"+String.valueOf(yue2);
					}else {
						month2 = String.valueOf(yue2);
					}
					if(day < 10) {
						day1 = "0"+String.valueOf(day);
					}else {
						day1 = String.valueOf(day);
					}
					if(ri2 < 10) {
						day2 = "0"+String.valueOf(ri2);
					}else {
						day2 = String.valueOf(ri2);
					}
					log.info("year1-->"+year1+" year2-->"+year2+" month1-->"+month1+" month2-->"+month2+" day1-->"+day1+" day2-->"+day2);
					//用于预定航班
					map.put("date", date);
					map.put("city1", c1);
					map.put("city2", c2);
					map.put("year1", year1);
					map.put("year2", year2);
					map.put("month1", month1);
					map.put("month2", month2);
					map.put("day1", day1);
					map.put("day2", day2);
					
					map.put("mark", "place");//用于li变换样式标识
					return map;
				}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("页面加载中......");
			}
		}
		return map;
	}
	
	/**
	 * 航班动态按照航班号查询
	 */
	@Override
	public Map<String, Object> flightDynamicsNum(String flightNumber, String date, int year, int month, int day) {
		Map<String, Object> map = new HashMap<String, Object>();
		List<FlightDynamics> flightDynamicsList = new ArrayList<FlightDynamics>();
		URLflightDynamicsNum = Csair.URLflightDynamics+"?s=2&f="+flightNumber+"&d="+date;
		flightDynamicsNumPage = webClient.getCsairHtmlPage(URLflightDynamicsNum, "URLflightDynamicsNum", false);

		HtmlPage page = flightDynamicsNumPage.getHtmlPage();
		for (int i = 0; i < timeoutmax; i++) {
				
				HtmlDivision alert_msg_box = (HtmlDivision) page.getElementById("alert_msg_box");
				if(alert_msg_box != null) {
					String style = alert_msg_box.getAttribute("style");
					if(!style.contains("none")) {
						HtmlDivision confirm_window = (HtmlDivision) alert_msg_box.getElementsByAttribute("div", "class", "confirm-window").get(0);
						String errorinfo = confirm_window.getElementsByTagName("p").get(0).asText();
						map.put("errorAlert", errorinfo);
						map.put("flightNumber", flightNumber);
						map.put("mark", "num");
						return map;
					}
				}
				
				List<HtmlElement> alert_infoDiv = page.getBody().getElementsByAttribute("div", "class", "alert-info");
				if(alert_infoDiv.size() != 0) {
					String alert_infoDivText = alert_infoDiv.get(0).asText();
					map.put("noflight", alert_infoDivText);
					map.put("flightNumber", flightNumber);
					map.put("mark", "num");
					return map;
				}
				HtmlUnorderedList flightListUl = (HtmlUnorderedList) page.getElementById("flightList");
				if(flightListUl != null) {
					HtmlDivision mainContentDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flt-mainContent").get(0);
					Document doc = Jsoup.parse(mainContentDiv.asXml());
					String place = doc.select(".title h1").get(0).text();
					map.put("place", place);
					
					flightListUl = (HtmlUnorderedList) page.getElementById("flightList");
					Iterable<DomElement> lis = flightListUl.getChildElements();
					for (DomElement domElement : lis) {
						HtmlElement li = (HtmlElement) domElement;
						FlightDynamics flightDynamics = new FlightDynamics();
						DomNodeList<HtmlElement> uls = li.getElementsByTagName("ul");
						if(uls.size() == 0) {
							Document liDoc = Jsoup.parse(li.asXml());
							String fl_info = liDoc.select(".num").get(0).text();
							flightDynamics.setFl_info(fl_info);
							String fl_dcity = liDoc.select(".dAirport").get(0).text();
							flightDynamics.setFl_dcity(fl_dcity);
							String fl_acity = liDoc.select(".aAirport").get(0).text();
							flightDynamics.setFl_acity(fl_acity);
							
							int fl_dtime11Size = liDoc.select(".depTime .time1").size();
							if(fl_dtime11Size > 0) {
								String fl_dtime11 = liDoc.select(".depTime .time1 .bold").get(0).text();
								flightDynamics.setFl_dtime11(fl_dtime11);
								String fl_dstatus11 = liDoc.select(".depTime .time1 .status").get(0).text();
								log.info("if fl_dstatus11====>"+fl_dstatus11);
								flightDynamics.setFl_dstatus11(fl_dstatus11);
								String fl_dtime12 = liDoc.select(".depTime .time2").get(0).text();
								flightDynamics.setFl_dtime12(fl_dtime12);
							}else {
								String fl_dtime12 = liDoc.select(".depTime").get(0).ownText();
								flightDynamics.setFl_dtime12(fl_dtime12);
							}
							
							int fl_arrtime11Size = liDoc.select(".arrTime .time1").size();
							if(fl_arrtime11Size > 0) {
								String fl_atime11 = liDoc.select(".arrTime .time1 .bold").get(0).text();
								flightDynamics.setFl_atime11(fl_atime11);
								String fl_astatus11 = liDoc.select(".depTime .time1 .status").get(0).text();
								log.info("if fl_astatus11====>"+fl_astatus11);
								flightDynamics.setFl_astatus11(fl_astatus11);
								String fl_atime12 = liDoc.select(".arrTime .time2").get(0).text();
								flightDynamics.setFl_atime12(fl_atime12);
							}else {
								String fl_atime12 = liDoc.select(".arrTime").get(0).ownText();
								flightDynamics.setFl_atime12(fl_atime12);
							}
							
							String fl_status = liDoc.select(".status .status-logo").text();
							flightDynamics.setFl_status1(fl_status);
							flightDynamics.setFl_count("1");
							flightDynamicsList.add(flightDynamics);
						}else {
							HtmlUnorderedList ul1 = (HtmlUnorderedList) uls.get(0);
							DomNodeList<HtmlElement> ullis = ul1.getElementsByTagName("li");
							HtmlElement ulli1 = ullis.get(0);
							Document ulli1Doc = Jsoup.parse(ulli1.asXml());
							String fl_info = ulli1Doc.select(".num").get(0).ownText();
							flightDynamics.setFl_info(fl_info);
							String fl_dcity = ulli1Doc.select(".dAirport").get(0).ownText();
							flightDynamics.setFl_dcity(fl_dcity);
							String fl_acity = ulli1Doc.select(".aAirport").get(0).ownText();
							flightDynamics.setFl_acity(fl_acity);
							int fl_dtime11Size = ulli1Doc.select(".depTime .time1").size();
							if(fl_dtime11Size > 0) {
								String fl_dtime11 = ulli1Doc.select(".depTime .time1 .bold").get(0).text();
								flightDynamics.setFl_dtime11(fl_dtime11);
								String fl_dstatus11 = ulli1Doc.select(".depTime .time1 .status").get(0).text();
								log.info("if fl_dstatus11====>"+fl_dstatus11);
								flightDynamics.setFl_dstatus11(fl_dstatus11);
								String fl_dtime12 = ulli1Doc.select(".depTime .time2").get(0).text();
								flightDynamics.setFl_dtime12(fl_dtime12);
							}else {
								String fl_dtime12 = ulli1Doc.select(".depTime").get(0).ownText();
								flightDynamics.setFl_dtime12(fl_dtime12);
							}
							
							int fl_arrtime11Size = ulli1Doc.select(".arrTime .time1").size();
							if(fl_arrtime11Size > 0) {
								String fl_atime11 = ulli1Doc.select(".arrTime .time1 .bold").get(0).text();
								flightDynamics.setFl_atime11(fl_atime11);
								String fl_astatus11 = ulli1Doc.select(".arrTime .time1 .status").get(0).text();
								flightDynamics.setFl_astatus11(fl_astatus11);
								String fl_atime12 = ulli1Doc.select(".arrTime .time2").get(0).text();
								flightDynamics.setFl_atime12(fl_atime12);
							}else {
								String fl_atime12 = ulli1Doc.select(".arrTime").get(0).ownText();
								flightDynamics.setFl_atime12(fl_atime12);
							}
							
							String fl_jingTing1 = ulli1Doc.select(".transfer-time .content span").get(0).text();
							String fl_jingTing2 = ulli1Doc.select(".transfer-time .content span").get(1).text();
							flightDynamics.setFl_jingTing(fl_jingTing1+" "+fl_jingTing2);
							
							String fl_status1 = ulli1.getElementsByAttribute("div", "class", "status-logo").get(0).asText();
							flightDynamics.setFl_status1(fl_status1);
							
							HtmlElement ulli3 = ullis.get(1);
							Document ulli3Doc = Jsoup.parse(ulli3.asXml());
							String fl_info2 = ulli3Doc.select(".num").get(0).ownText();
							flightDynamics.setFl_info2(fl_info2);
							String fl_dcity2 = ulli3Doc.select(".dAirport").get(0).ownText();
							flightDynamics.setFl_dcity2(fl_dcity2);
							String fl_acity2 = ulli3Doc.select(".aAirport").get(0).ownText();
							flightDynamics.setFl_acity2(fl_acity2);
							int fl_dtime21Size = ulli3Doc.select(".depTime .time1").size();
							if(fl_dtime21Size > 0) {
								String fl_dtime21 = ulli3Doc.select(".depTime .time1 .bold").get(0).text();
								flightDynamics.setFl_dtime21(fl_dtime21);
								String fl_dstatus21 = ulli3Doc.select(".depTime .time1 .status").get(0).text();
								flightDynamics.setFl_dstatus21(fl_dstatus21);
								String fl_dtime22 = ulli3Doc.select(".depTime .time2").get(0).text();
								flightDynamics.setFl_dtime22(fl_dtime22);
							}else {
								String fl_dtime22 = ulli3Doc.select(".depTime").get(0).ownText();
								flightDynamics.setFl_dtime22(fl_dtime22);
							}
							
							int fl_arrtime21Size = ulli3Doc.select(".arrTime .time1").size();
							if(fl_arrtime21Size > 0) {
								String fl_atime21 = ulli3Doc.select(".arrTime .time1 .bold").get(0).text();
								flightDynamics.setFl_atime21(fl_atime21);
								String fl_astatus21 = ulli3Doc.select(".arrTime .time1 .status").get(0).text();
								flightDynamics.setFl_astatus21(fl_astatus21);
								String fl_atime22 = ulli3Doc.select(".arrTime .time2").get(0).text();
								flightDynamics.setFl_atime22(fl_atime22);
							}else {
								String fl_atime22 = ulli3Doc.select(".arrTime").get(0).ownText();
								flightDynamics.setFl_atime22(fl_atime22);
							}
							String fl_status2 = ulli3.getElementsByAttribute("div", "class", "status-logo").get(0).asText();
							flightDynamics.setFl_status2(fl_status2);
						//	flightDynamics.setFl_count("2");//用于记录该条信息的行数（是否有经停，经停为2）
							flightDynamicsList.add(flightDynamics);
						}
					}
					map.put("flightDynamicsList", flightDynamicsList);
					int nian2 = 0;int yue2 = 0;int ri2 = 0;
					if(month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 ) {
						if(day == 31) {
							nian2 = year;
							yue2 = month+1;
							ri2 = 1;
						}else {
							nian2 = year;
							yue2 = month;
							ri2 = day+1;
						}
					}else if(month == 4 || month == 6 || month == 9 || month == 11) {
						if(day == 30) {
							nian2 = year;
							yue2 = month+1;
							ri2 = 1;
						}else {
							nian2 = year;
							yue2 = month;
							ri2 = day+1;
						}
					}else if(year%4 != 0 && month == 2) {
						if(day == 28) {
							nian2 = year;
							yue2 = month+1;
							ri2 = 1;
						}else {
							nian2 = year;
							yue2 = month;
							ri2 = day+1;
						}
					}else if(year%4 == 0 && month == 2) {
						if(day == 29) {
							nian2 = year;
							yue2 = month+1;
							ri2 = 1;
						}else {
							nian2 = year;
							yue2 = month;
							ri2 = day+1;
						}
					}else if(month == 12) {
						if(day == 31) {
							nian2 = year + 1;
							yue2 = 1;
							ri2 = 1;
						}else {
							nian2 = year;
							yue2 = month;
							ri2 = day+1;
						}
					}
					String year1 = String.valueOf(year);
					String year2 = String.valueOf(nian2);
					String month1 = null;
					String month2 = null;
					String day1 = null;
					String day2 = null;
					if(month < 10) {
						month1 = "0"+String.valueOf(month);
					}else {
						month1 = String.valueOf(month);
					}
					if(yue2 < 10) {
						month2 = "0"+String.valueOf(yue2);
					}else {
						month2 = String.valueOf(yue2);
					}
					if(day < 10) {
						day1 = "0"+String.valueOf(day);
					}else {
						day1 = String.valueOf(day);
					}
					if(ri2 < 10) {
						day2 = "0"+String.valueOf(ri2);
					}else {
						day2 = String.valueOf(ri2);
					}
					log.info("year1-->"+year1+" year2-->"+year2+" month1-->"+month1+" month2-->"+month2+" day1-->"+day1+" day2-->"+day2);
					DomNodeList<HtmlElement> lis2 = flightListUl.getElementsByTagName("li");
					HtmlElement li0 = lis2.get(0);
					String data_date = li0.getAttribute("data-date");
					map.put("date", data_date);
					String data_city1 = li0.getAttribute("data-city1");
					map.put("city1", data_city1);
					String data_city2 = li0.getAttribute("data-city2");
					map.put("city2", data_city2);
					map.put("year1", year1);
					map.put("year2", year2);
					map.put("month1", month1);
					map.put("month2", month2);
					map.put("day1", day1);
					map.put("day2", day2);
					
					map.put("flightNumber", flightNumber);
					map.put("mark", "num");
					return map;
				}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("页面加载中......");
			}
		}
		return map;
	}
	
	/**
	 * 加载常用联系人
	 */
	@Override
	public Map<String, Object> commContactorLoad() {
		Map<String, Object> map = new HashMap<String, Object>();
		List<CommContactorInfo> commContactorInfoList = new ArrayList<CommContactorInfo>();
		commContactorPage = webClient.getCsairHtmlPage(Csair.commContactorPage, "commContactorPage", false);
		HtmlPage page = commContactorPage.getHtmlPage();
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision record_listDiv = (HtmlDivision) page.getElementById("record_list");
			if(record_listDiv != null) {
				Document doc = Jsoup.parse(record_listDiv.asXml());
				Elements spans = doc.select("span.red");
				if(spans.size() != 0 ) {
					String noCommContactorInfo = spans.get(0).text();
					map.put("noCommContactorInfo", noCommContactorInfo);
					map.put("notice", "true");
					return map;
				}
				Elements divs = doc.select("div.table_cell");
				if(divs.size() != 0) {
					for (Iterator iterator = divs.iterator(); iterator.hasNext();) {
						CommContactorInfo commContactorInfo = new CommContactorInfo();
						Element div = (Element) iterator.next();
						String xuHao = div.select("li").get(0).text();
						String contactorName = div.select("li").get(1).text();
						String phoneNum = div.select("li").get(2).text();
						String eMail = div.select("li").get(3).attr("title");
						String cardNum = div.select("li").get(4).text();
						commContactorInfo.setXuHao(xuHao);
						commContactorInfo.setContactorName(contactorName);
						commContactorInfo.setPhoneNum(phoneNum);
						commContactorInfo.seteMail(eMail);
						commContactorInfo.setCardNum(cardNum);
						commContactorInfoList.add(commContactorInfo);
					}
					HtmlDivision page_div = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "page_div").get(0);
					map.put("page_div", page_div.asXml());
					map.put("commContactorInfoList", commContactorInfoList);
					map.put("notice", "true");
					return map;
				}
			}
			synchronized (page) {
				try {
					page.wait(1000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载页面......");
			}
		}
		map.put("noCommContactorInfo", "查无此记录，请输入正确信息！");
		return map;
	}

	/**
	 * 按照姓名查找常用联系人
	 */
	@Override
	public Map<String, Object> contactNameCheck(String contactorNamebeChecked) {
		Map<String, Object> map = new HashMap<String, Object>();
		List<CommContactorInfo> commContactorInfoList = new ArrayList<CommContactorInfo>();
		HtmlPage page = commContactorPage.getHtmlPage();
		HtmlInput contact_nameInput = (HtmlInput) page.getElementById("contact_name");
		contact_nameInput.setValueAttribute(contactorNamebeChecked);
		HtmlAnchor search_btn = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "class", "search_btn").get(0);
		clickHandler(search_btn);
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision record_listDiv = (HtmlDivision) page.getElementById("record_list");
			if(record_listDiv != null) {
				Document doc = Jsoup.parse(record_listDiv.asXml());
				Elements spans = doc.select("span.red");
				if(spans.size() != 0 ) {
					String noCommContactorInfo = spans.get(0).text();
					map.put("noCommContactorInfo", noCommContactorInfo);
					map.put("notice", "true");
					return map;
				}
				Elements divs = doc.select("div.table_cell");
				if(divs.size() != 0) {
					for (Iterator iterator = divs.iterator(); iterator.hasNext();) {
						CommContactorInfo commContactorInfo = new CommContactorInfo();
						Element div = (Element) iterator.next();
						String xuHao = div.select("li").get(0).text();
						String contactorName = div.select("li").get(1).text();
						String phoneNum = div.select("li").get(2).text();
						String eMail = div.select("li").get(3).attr("title");
						String cardNum = div.select("li").get(4).text();
						commContactorInfo.setXuHao(xuHao);
						commContactorInfo.setContactorName(contactorName);
						commContactorInfo.setPhoneNum(phoneNum);
						commContactorInfo.seteMail(eMail);
						commContactorInfo.setCardNum(cardNum);
						commContactorInfoList.add(commContactorInfo);
					}
					HtmlDivision page_div = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "page_div").get(0);
					map.put("page_div", page_div.asXml());
					map.put("commContactorInfoList", commContactorInfoList);
					map.put("notice", "true");
					return map;
				}
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载页面......");
			}
		}
		map.put("noCommContactorInfo", "查无此记录，请输入正确信息！");
		return map;
	}

	/**
	 * 加载增加常用联系人页面
	 */
	@Override
	public Map<String, Object> addCommContactorPageLoad() {
		Map<String, Object> map = new HashMap<String ,Object>();
		addCommContactorPage = webClient.getCsairHtmlPage(Csair.addCommContactorPage, "addCommContactorPage", false);
		HtmlPage page = addCommContactorPage.getHtmlPage();
		for (int i = 0; i < timeoutmax; i++) {
			HtmlInput contactNameInput = (HtmlInput) page.getElementById("contactName");
			if(contactNameInput != null) {
				map.put("notice", "true");
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("页面加载中.....");
			}
		}
		map.put("notice", "false");
		return map;
	}

	/**
	 * 保存新增联系人信息
	 */
	@Override
	public Map<String, Object> saveCommContactor(String contactName, String contactPhone, String contactFPNO,
			String contactEmail) {
		scl.URLsaveCommContactor = null;
		alertMessage = null;
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = addCommContactorPage.getHtmlPage();
		HtmlInput contactNameInput = (HtmlInput) page.getElementById("contactName");
		contactNameInput.setValueAttribute(contactName);
		HtmlInput contactPhoneInput = (HtmlInput) page.getElementById("contactPhone");
		contactPhoneInput.setValueAttribute(contactPhone);
		HtmlInput contactFPNOInput = (HtmlInput) page.getElementById("contactFPNO");
		contactFPNOInput.setValueAttribute(contactFPNO);
		HtmlInput contactEmailInput = (HtmlInput) page.getElementById("contactEmail");
		contactEmailInput.setValueAttribute(contactEmail);
		HtmlInput usercookieIDInput = (HtmlInput) page.getElementById("usercookieID");
		clickHandler(usercookieIDInput);
		HtmlSpan bnSpan = (HtmlSpan) page.getBody().getElementsByAttribute("span", "class", "bn").get(0);
		clickHandler(bnSpan);
		 List<HtmlElement> errorinfoSpan = page.getBody().getElementsByAttribute("span", "class", "errorinfo");
		if(errorinfoSpan.size() != 0) {
			String errorinfoSpanText = errorinfoSpan.get(0).asText();
			map.put("errorinfo", errorinfoSpanText);
			return map;
		}
		for (int i = 0; i < timeoutmax; i++) {
			if(scl.URLsaveCommContactor != null && alertMessage != null) {
				log.info("alertMessage===>"+alertMessage);
				map.put("msg", alertMessage);
				map.put("errorinfo", "null");
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("正在加载文件......");
			}
		}
		map.put("msg", "保存失败！");
		map.put("errorinfo", "null");
		return map;
	}

	/**
	 * 根据class跳页加载常用联系人信息
	 */
	@Override
	public Map<String, Object> commContactorLoadPageClass(String aClass) {
		Map<String, Object> map = new HashMap<String, Object>();
		List<CommContactorInfo> commContactorInfoList = new ArrayList<CommContactorInfo>();
		HtmlPage page = commContactorPage.getHtmlPage();
		HtmlAnchor a = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "class", aClass).get(0);
		clickHandler(a);
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision record_listDiv = (HtmlDivision) page.getElementById("record_list");
			if(record_listDiv != null) {
				Document doc = Jsoup.parse(record_listDiv.asXml());
				Elements divs = doc.select("div.table_cell");
				if(divs.size() != 0) {
					for (Iterator iterator = divs.iterator(); iterator.hasNext();) {
						CommContactorInfo commContactorInfo = new CommContactorInfo();
						Element div = (Element) iterator.next();
						String xuHao = div.select("li").get(0).text();
						String contactorName = div.select("li").get(1).text();
						String phoneNum = div.select("li").get(2).text();
						String eMail = div.select("li").get(3).attr("title");
						String cardNum = div.select("li").get(4).text();
						commContactorInfo.setXuHao(xuHao);
						commContactorInfo.setContactorName(contactorName);
						commContactorInfo.setPhoneNum(phoneNum);
						commContactorInfo.seteMail(eMail);
						commContactorInfo.setCardNum(cardNum);
						commContactorInfoList.add(commContactorInfo);
					}
					HtmlDivision page_div = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "page_div").get(0);
					map.put("page_div", page_div.asXml());
					map.put("commContactorInfoList", commContactorInfoList);
					map.put("notice", "true");
					return map;
				}
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载页面......");
			}
		}
		map.put("noCommContactorInfo", "查无此记录，请输入正确信息！");
		return map;
	}
	
	/**
	 * 根据id跳页加载常用联系人信息
	 */
	@Override
	public Map<String, Object> commContactorLoadPageId(String aId) {
		Map<String, Object> map = new HashMap<String, Object>();
		List<CommContactorInfo> commContactorInfoList = new ArrayList<CommContactorInfo>();
		HtmlPage page = commContactorPage.getHtmlPage();
		HtmlAnchor a = (HtmlAnchor) page.getElementById(aId);
		clickHandler(a);
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision record_listDiv = (HtmlDivision) page.getElementById("record_list");
			if(record_listDiv != null) {
				Document doc = Jsoup.parse(record_listDiv.asXml());
				Elements divs = doc.select("div.table_cell");
				if(divs.size() != 0) {
					for (Iterator iterator = divs.iterator(); iterator.hasNext();) {
						CommContactorInfo commContactorInfo = new CommContactorInfo();
						Element div = (Element) iterator.next();
						String xuHao = div.select("li").get(0).text();
						String contactorName = div.select("li").get(1).text();
						String phoneNum = div.select("li").get(2).text();
						String eMail = div.select("li").get(3).attr("title");
						String cardNum = div.select("li").get(4).text();
						commContactorInfo.setXuHao(xuHao);
						commContactorInfo.setContactorName(contactorName);
						commContactorInfo.setPhoneNum(phoneNum);
						commContactorInfo.seteMail(eMail);
						commContactorInfo.setCardNum(cardNum);
						commContactorInfoList.add(commContactorInfo);
					}
					HtmlDivision page_div = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "page_div").get(0);
					map.put("page_div", page_div.asXml());
					map.put("commContactorInfoList", commContactorInfoList);
					map.put("notice", "true");
					return map;
				}
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载页面......");
			}
		}
		map.put("noCommContactorInfo", "查无此记录，请输入正确信息！");
		return map;
	}
	
	/**
	 *  点击修改常用联系人
	 */
	@Override
	public Map<String, Object> checkEditCommContactor(String num) {
		scl.EditCommContactorPage = null;
		scl.EditCommContactor = null;
		Map<String, Object> map = new HashMap<String,Object>();
		HtmlPage page = commContactorPage.getHtmlPage();
		List<HtmlElement> liShort = page.getBody().getElementsByAttribute("li", "class", "short");
		for (int i = 0; i < liShort.size(); i++) {
			HtmlListItem li = (HtmlListItem) liShort.get(i);
			String xuhao = li.asText();
			log.info("xuhao===>"+xuhao);
			if(xuhao.equals(num)) {
				HtmlUnorderedList ul = (HtmlUnorderedList) li.getParentNode();
				HtmlListItem liLast = (HtmlListItem) ul.getLastChild();
				HtmlAnchor aEdit = (HtmlAnchor) liLast.getElementsByAttribute("a", "class", "edit-info").get(0);
				clickHandler(aEdit);
				for (int j = 0; j < timeoutmax; j++) {
					if(scl.EditCommContactorPage != null) {
						EditCommContactorPage = webClient.getCsairHtmlPage(scl.EditCommContactorPage, "EditCommContactorPage", false);
						map.put("notice", "true");
						return map;
					}
					synchronized (page) {
						try {
							page.wait(1000);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						log.info("页面加载中......");
					}
				}
				
			}
		}
		map.put("notice", "页面加载超时！");
		return map;
	}
	/**
	 * 加载修改常用联系人页面
	 */
	@Override
	public Map<String, Object> loadEditCommContactor() {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = EditCommContactorPage.getHtmlPage();
		HtmlInput contactNameInput = (HtmlInput) page.getElementById("contactName");
		for (int i = 0; i < timeoutmax; i++) {
			if(contactNameInput != null) {
				String contactName = contactNameInput.asText().trim();
				if(contactName.length() != 0) {
					map.put("contactName",contactName);
					String contactPhone = page.getElementById("contactPhone").asText().trim();
					map.put("contactPhone",contactPhone);
					String contactEmail = page.getElementById("contactEmail").asText().trim();
					map.put("contactEmail",contactEmail);
					String contactFPNO = page.getElementById("contactFPNO").asText().trim();
					map.put("contactFPNO",contactFPNO);
					return map;
				}
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("修改常用联系人页面加载.....");
			}
		}
		
		
//		DomNodeList<HtmlElement> lis = ul.getElementsByTagName("li");
//		map.put("contactName", lis.get(1).asText());
//		map.put("contactPhone", lis.get(2).asText());
//		map.put("contactEmail", lis.get(3).getAttribute("title"));
//		map.put("contactFPNO", lis.get(4).asText());
		return map;
	}
	
	//保存修改常用联系人
	@Override
	public Map<String, Object> saveEditCommContactor(String contactName, String contactPhone, String contactFPNO,
			String contactEmail) {
		scl.URLsaveCommContactor = null;
		alertMessage = null;
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = EditCommContactorPage.getHtmlPage();
		HtmlInput contactNameInput = (HtmlInput) page.getElementById("contactName");
		contactNameInput.setValueAttribute(contactName);
		HtmlInput contactPhoneInput = (HtmlInput) page.getElementById("contactPhone");
		contactPhoneInput.setValueAttribute(contactPhone);
		HtmlInput contactFPNOInput = (HtmlInput) page.getElementById("contactFPNO");
		contactFPNOInput.setValueAttribute(contactFPNO);
		HtmlInput contactEmailInput = (HtmlInput) page.getElementById("contactEmail");
		contactEmailInput.setValueAttribute(contactEmail);
		HtmlInput usercookieIDInput = (HtmlInput) page.getElementById("usercookieID");
		clickHandler(usercookieIDInput);
		HtmlSpan bnSpan = (HtmlSpan) page.getBody().getElementsByAttribute("span", "class", "bn").get(0);
		clickHandler(bnSpan);
		 List<HtmlElement> errorinfoSpan = page.getBody().getElementsByAttribute("span", "class", "errorinfo");
		if(errorinfoSpan.size() != 0) {
			String errorinfoSpanText = errorinfoSpan.get(0).asText();
			log.info("页面有错误提示！！！"+errorinfoSpanText);
			map.put("errorinfo", errorinfoSpanText);
			return map;
		}
		for (int i = 0; i < timeoutmax; i++) {
			if(scl.URLsaveCommContactor != null && alertMessage != null) {
				log.info("alertMessage===>"+alertMessage);
				map.put("msg", alertMessage);
				map.put("errorinfo", "null");
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("正在加载文件......");
			}
		}
		map.put("msg", "保存失败！");
		map.put("errorinfo", "null");
		return map;
	}

	/**
	 * 点击删除常用联系人
	 */
	@Override
	public Map<String, Object> checkDelCommContactor(String num) {
		confirmMessage = null;
		Map<String, Object> map = new HashMap<String,Object>();
		HtmlPage page = commContactorPage.getHtmlPage();
		List<HtmlElement> liShort = page.getBody().getElementsByAttribute("li", "class", "short");
		for (int i = 0; i < liShort.size(); i++) {
			HtmlListItem li = (HtmlListItem) liShort.get(i);
			String xuhao = li.asText();
			if(xuhao.equals(num)) {
				HtmlUnorderedList ul = (HtmlUnorderedList) li.getParentNode();
				HtmlListItem liLast = (HtmlListItem) ul.getLastChild();
				HtmlAnchor aDel = (HtmlAnchor) liLast.getElementsByAttribute("a", "class", "del-info").get(0);
				clickHandler(aDel);
				for (int j = 0; j < timeoutmax; j++) {
					if(confirmMessage != null) {
						map.put("notice", "true");
						return map;
					}
					synchronized (page) {
						try {
							page.wait(500);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						log.info("等待提示信息中......");
					}
				}
			}
		}
		return map;
	}

	/**
	 * 加载常用旅客管理页面
	 */
	@Override
	public Map<String, Object> commPassengerLoad() {
		Map<String, Object> map = new HashMap<String, Object>();
		List<CommPassengerInfo> commPassengerInfoList = new ArrayList<CommPassengerInfo>();
		commPassengerPage = webClient.getCsairHtmlPage(Csair.commPassengerPage, "commPassengerPage", false);
		HtmlPage page = commPassengerPage.getHtmlPage();
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision record_listDiv = (HtmlDivision) page.getElementById("record_list");
			if(record_listDiv != null) {
				Document doc = Jsoup.parse(record_listDiv.asXml());
				Elements spans = doc.select("span.red");
				if(spans.size() != 0 ) {
					String noCommContactorInfo = spans.get(0).text();
					map.put("noCommPassengerInfo", noCommContactorInfo);
					map.put("notice", "true");
					return map;
				}
				Elements divs = doc.select("div.table_cell");
				if(divs.size() != 0) {
					for (Iterator iterator = divs.iterator(); iterator.hasNext();) {
						CommPassengerInfo commPassengerInfo = new CommPassengerInfo();
						Element div = (Element) iterator.next();
						String passengerName = div.select("li").get(0).text();
						String domesticOrInternational = div.select("li").get(1).text();
						String passengerType = div.select("li").get(2).text();
						String cardNum = div.select("li").get(3).text();
						commPassengerInfo.setPassengerName(passengerName);;
						commPassengerInfo.setDomesticOrInternational(domesticOrInternational);;
						commPassengerInfo.setPassengerType(passengerType);;
						commPassengerInfo.setCardNum(cardNum);
						commPassengerInfoList.add(commPassengerInfo);
					}
					HtmlDivision page_div = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "page_div").get(0);
					map.put("page_div", page_div.asXml());
					map.put("commPassengerInfoList", commPassengerInfoList);
					map.put("notice", "true");
					return map;
				}
			}
			synchronized (page) {
				try {
					page.wait(1000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载页面......");
			}
		}
		map.put("noCommPassengerInfo", "查无此记录，请输入正确信息！");
		return map;
	}

	/**
	 * 根据class跳页加载常用旅客管理
	 */
	@Override
	public Map<String, Object> commPassengerLoadPageClass(String aClass) {
		Map<String, Object> map = new HashMap<String, Object>();
		List<CommPassengerInfo> commPassengerInfoList = new ArrayList<CommPassengerInfo>();
		HtmlPage page = commPassengerPage.getHtmlPage();
		HtmlAnchor a = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "class", aClass).get(0);
		clickHandler(a);
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision record_listDiv = (HtmlDivision) page.getElementById("record_list");
			if(record_listDiv != null) {
				Document doc = Jsoup.parse(record_listDiv.asXml());
				Elements spans = doc.select("span.red");
				if(spans.size() != 0 ) {
					String noCommContactorInfo = spans.get(0).text();
					map.put("noCommPassengerInfo", noCommContactorInfo);
					map.put("notice", "true");
					return map;
				}
				Elements divs = doc.select("div.table_cell");
				if(divs.size() != 0) {
					for (Iterator iterator = divs.iterator(); iterator.hasNext();) {
						CommPassengerInfo commPassengerInfo = new CommPassengerInfo();
						Element div = (Element) iterator.next();
						String passengerName = div.select("li").get(0).text();
						String domesticOrInternational = div.select("li").get(1).text();
						String passengerType = div.select("li").get(2).text();
						String cardNum = div.select("li").get(3).text();
						commPassengerInfo.setPassengerName(passengerName);;
						commPassengerInfo.setDomesticOrInternational(domesticOrInternational);;
						commPassengerInfo.setPassengerType(passengerType);;
						commPassengerInfo.setCardNum(cardNum);
						commPassengerInfoList.add(commPassengerInfo);
					}
					HtmlDivision page_div = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "page_div").get(0);
					map.put("page_div", page_div.asXml());
					map.put("commPassengerInfoList", commPassengerInfoList);
					map.put("notice", "true");
					return map;
				}
			}
			synchronized (page) {
				try {
					page.wait(1000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载页面......");
			}
		}
		map.put("noCommPassengerInfo", "查无此记录，请输入正确信息！");
		return map;
	}
	
	/**
	 * 根据id跳页加载常用旅客管理
	 */
	@Override
	public Map<String, Object> commPassengerLoadPageId(String aId) {
		Map<String, Object> map = new HashMap<String, Object>();
		List<CommPassengerInfo> commPassengerInfoList = new ArrayList<CommPassengerInfo>();
		HtmlPage page = commPassengerPage.getHtmlPage();
		HtmlAnchor a = (HtmlAnchor) page.getElementById(aId);
		clickHandler(a);
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision record_listDiv = (HtmlDivision) page.getElementById("record_list");
			if(record_listDiv != null) {
				Document doc = Jsoup.parse(record_listDiv.asXml());
				Elements spans = doc.select("span.red");
				if(spans.size() != 0 ) {
					String noCommContactorInfo = spans.get(0).text();
					map.put("noCommPassengerInfo", noCommContactorInfo);
					map.put("notice", "true");
					return map;
				}
				Elements divs = doc.select("div.table_cell");
				if(divs.size() != 0) {
					for (Iterator iterator = divs.iterator(); iterator.hasNext();) {
						CommPassengerInfo commPassengerInfo = new CommPassengerInfo();
						Element div = (Element) iterator.next();
						String passengerName = div.select("li").get(0).text();
						String domesticOrInternational = div.select("li").get(1).text();
						String passengerType = div.select("li").get(2).text();
						String cardNum = div.select("li").get(3).text();
						commPassengerInfo.setPassengerName(passengerName);;
						commPassengerInfo.setDomesticOrInternational(domesticOrInternational);;
						commPassengerInfo.setPassengerType(passengerType);;
						commPassengerInfo.setCardNum(cardNum);
						commPassengerInfoList.add(commPassengerInfo);
					}
					HtmlDivision page_div = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "page_div").get(0);
					map.put("page_div", page_div.asXml());
					map.put("commPassengerInfoList", commPassengerInfoList);
					map.put("notice", "true");
					return map;
				}
			}
			synchronized (page) {
				try {
					page.wait(1000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载页面......");
			}
		}
		map.put("noCommPassengerInfo", "查无此记录，请输入正确信息！");
		return map;
	}
	
	/**
	 * 按照姓名查找常用旅客
	 */
	@Override
	public Map<String, Object> passengerNameCheck(String psg_tpye, String passengerNameBeChecked) {
		log.info("psg_tpye==>"+psg_tpye+" passengerNameBeChecked==>"+passengerNameBeChecked);
		Map<String, Object> map = new HashMap<String, Object>();
		List<CommPassengerInfo> commPassengerInfoList = new ArrayList<CommPassengerInfo>();
		HtmlPage page = commPassengerPage.getHtmlPage();
		HtmlSelect psg_tpyeSelect = (HtmlSelect) page.getElementById("psg_tpye");
		HtmlOption psg_tpyeValue = psg_tpyeSelect.getOptionByValue(psg_tpye);
		psg_tpyeValue.setSelected(true);
		HtmlInput psg_nameInput = (HtmlInput) page.getElementById("psg_name");
		psg_nameInput.setValueAttribute(passengerNameBeChecked);
		HtmlAnchor search_btn = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "class", "search_btn").get(0);
		clickHandler(search_btn);
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision record_listDiv = (HtmlDivision) page.getElementById("record_list");
			if(record_listDiv != null) {
				Document doc = Jsoup.parse(record_listDiv.asXml());
				Elements spans = doc.select("span.red");
				if(spans.size() != 0 ) {
					String noCommContactorInfo = spans.get(0).text();
					map.put("noCommPassengerInfo", noCommContactorInfo);
					map.put("notice", "true");
					return map;
				}
				Elements divs = doc.select("div.table_cell");
				if(divs.size() != 0) {
					for (Iterator iterator = divs.iterator(); iterator.hasNext();) {
						CommPassengerInfo commPassengerInfo = new CommPassengerInfo();
						Element div = (Element) iterator.next();
						String passengerName = div.select("li").get(0).text();
						String domesticOrInternational = div.select("li").get(1).text();
						String passengerType = div.select("li").get(2).text();
						String cardNum = div.select("li").get(3).text();
						commPassengerInfo.setPassengerName(passengerName);;
						commPassengerInfo.setDomesticOrInternational(domesticOrInternational);;
						commPassengerInfo.setPassengerType(passengerType);;
						commPassengerInfo.setCardNum(cardNum);
						commPassengerInfoList.add(commPassengerInfo);
					}
					HtmlDivision page_div = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "page_div").get(0);
					map.put("page_div", page_div.asXml());
					map.put("commPassengerInfoList", commPassengerInfoList);
					map.put("notice", "true");
					return map;
				}
			}
			synchronized (page) {
				try {
					page.wait(1000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载页面......");
			}
		}
		map.put("noCommPassengerInfo", "查无此记录，请输入正确信息！");
		return map;
	}

	/**
	 * 点击查看常用旅客信息
	 */
	@Override
	public Map<String, Object> checkViewPassenger(String passengerName, String domesticOrInternational,
			String passengerType, String cardNum) {
		scl.viewCommPassengerPage = null;
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = commPassengerPage.getHtmlPage();
		List<HtmlElement> table_cells = page.getBody().getElementsByAttribute("div", "class", "table_cell");
		for (int i = 0; i < table_cells.size(); i++) {
			HtmlElement table_cell = table_cells.get(i);
			DomNodeList<HtmlElement> lis = table_cell.getElementsByTagName("li");
			String name = lis.get(0).asText();
			String doi = lis.get(1).asText();
			String type = lis.get(2).asText();
			String num = lis.get(3).asText();
			if(passengerName.equals(name) && domesticOrInternational.equals(doi) && passengerType.equals(type) && cardNum.equals(num)) {
				HtmlUnorderedList ul = (HtmlUnorderedList) table_cell.getElementsByTagName("ul").get(0);
				HtmlListItem liLast = (HtmlListItem) ul.getLastChild();
				HtmlAnchor aView = (HtmlAnchor) liLast.getElementsByAttribute("a", "class", "view-info").get(0);
				clickHandler(aView);
				for (int j = 0; j < timeoutmax; j++) {
					if(scl.viewCommPassengerPage != null) {
						viewCommPassengerPage = webClient.getCsairHtmlPage(scl.viewCommPassengerPage, "viewCommPassengerPage", false);
						map.put("notice", "true");
						return map;
					}
					synchronized (page) {
						try {
							page.wait(1000);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						log.info("正在加载查看页面.....");
					}
				}
			}
		}
		return map;
	}
	/**
	 * 加载查看常用旅客信息
	 */
	@Override
	public Map<String, Object> loadViewPassenger() {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = viewCommPassengerPage.getHtmlPage();
		for (int k = 0; k < timeoutmax; k++) {
			List<HtmlElement> txt_infos = page.getBody().getElementsByAttribute("span", "class", "txt-info");
			if(txt_infos.size() != 0) {
				String commPassengerType = page.getBody().getElementsByAttribute("span", "class", "radio-item").get(0).asText();
				map.put("commPassengerType", commPassengerType);
				String passengerTypeText = txt_infos.get(0).asText();
				map.put("passengerType", passengerTypeText);
				String passengerNameText = txt_infos.get(1).asText();
				map.put("passengerName", passengerNameText);
				String mzCardNumText = txt_infos.get(2).asText();
				map.put("mzCardNum", mzCardNumText);
				String cardNumText = txt_infos.get(3).asText();
				map.put("cardNum", cardNumText);
				String birthdayText = txt_infos.get(4).asText();
				map.put("birthday", birthdayText);
				String phoneNumText = txt_infos.get(5).asText();
				map.put("phoneNum", phoneNumText);
				String emailText = txt_infos.get(6).asText();
				map.put("email", emailText);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("正在加载查看页面中信息......");
			}
		}
		return map;
	}
	
	/**
	 * 点击删除常用旅客
	 */
	@Override
	public Map<String, Object> checkDelCommPassenger(String passengerName, String domesticOrInternational,
			String passengerType, String cardNum) {
			confirmMessage = null;
			Map<String, Object> map = new HashMap<String, Object>();
			HtmlPage page = commPassengerPage.getHtmlPage();
			List<HtmlElement> table_cells = page.getBody().getElementsByAttribute("div", "class", "table_cell");
			for (int i = 0; i < table_cells.size(); i++) {
				HtmlElement table_cell = table_cells.get(i);
				DomNodeList<HtmlElement> lis = table_cell.getElementsByTagName("li");
				String name = lis.get(0).asText();
				String doi = lis.get(1).asText();
				String type = lis.get(2).asText();
				String num = lis.get(3).asText();
				if(passengerName.equals(name) && domesticOrInternational.equals(doi) && passengerType.equals(type) && cardNum.equals(num)) {
					HtmlUnorderedList ul = (HtmlUnorderedList) table_cell.getElementsByTagName("ul").get(0);
					HtmlListItem liLast = (HtmlListItem) ul.getLastChild();
					HtmlAnchor aDel = (HtmlAnchor) liLast.getElementsByAttribute("a", "class", "del-info").get(0);
					clickHandler(aDel);
					for (int j = 0; j < timeoutmax; j++) {
						if(confirmMessage != null) {
							map.put("notice", "true");
							return map;
						}
						synchronized (page) {
							try {
								page.wait(1000);
							} catch (InterruptedException e) {
								e.printStackTrace();
							}
							log.info("等待页面提示信息.....");
						}
					}
				}
			}
			return map;
		}
	
	/**
	 * 加载增加常用旅客页面
	 */
	@Override
	public Map<String, Object> addCommPassengerPageLoad() {
		Map<String, Object> map = new HashMap<String ,Object>();
		addCommPassengerPage = webClient.getCsairHtmlPage(Csair.addCommPassengerPage, "addCommPassengerPage", false);
		HtmlPage page = addCommPassengerPage.getHtmlPage();
		for (int i = 0; i < timeoutmax; i++) {
			HtmlInput psgNameInput = (HtmlInput) page.getElementById("psgName");
			if(psgNameInput != null) {
				map.put("notice", "true");
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("页面加载中.....");
			}
		}
		map.put("notice", "false");
		return map;
	}
	
	/**
	 * 保存常用旅客（成人）
	 */
	@Override
	public Map<String, Object> saveCommPassengerAdult(String psgName, String psgFPNO, String cardType, String cardNum,
			String phoneNum, String email) {
		scl.URLsaveCommPassenger = null;
		alertMessage = null;
		Map<String, Object> map = new HashMap<String ,Object>();
		HtmlPage page = addCommPassengerPage.getHtmlPage();
		HtmlInput radio0Input = (HtmlInput) page.getElementById("radio0");
		clickHandler(radio0Input);
		HtmlInput psgNameInput = (HtmlInput) page.getElementById("psgName");
		psgNameInput.setValueAttribute(psgName);
		HtmlInput psgFPNOInput = (HtmlInput) page.getElementById("psgFPNO");
		psgFPNOInput.setValueAttribute(psgFPNO);
		clickHandler(page.getElementById("idtypetext"));
		DomNodeList<HtmlElement> lis = page.getElementById("identityTypeUl").getElementsByTagName("li");
		for (int i = 0; i < lis.size(); i++) {
			String liVal = lis.get(i).getAttribute("val");
//			log.info("liVal===>"+liVal+",cardType===>"+cardType);
			if(cardType.equals(liVal)) {
				lis.get(i).focus();
				clickHandler(lis.get(i));
			}
		}
		HtmlInput idcardInput = (HtmlInput) page.getElementById("idcard");
		idcardInput.setValueAttribute(cardNum);
		HtmlInput psgPhoneInput = (HtmlInput) page.getElementById("psgPhone");
		psgPhoneInput.setValueAttribute(phoneNum);
		HtmlInput psgEmailInput = (HtmlInput) page.getElementById("psgEmail");
		psgEmailInput.setValueAttribute(email);
		HtmlInput usercookieIDInput = (HtmlInput) page.getElementById("usercookieID");
		clickHandler(usercookieIDInput);
		HtmlSpan saveBtn = (HtmlSpan) page.getBody().getElementsByAttribute("span", "class", "bn").get(0);
		clickHandler(saveBtn);
		List<HtmlElement> errorinfoSpan = page.getBody().getElementsByAttribute("span", "class", "errorinfo");
		if(errorinfoSpan.size() != 0) {
			String errorinfoSpanText = errorinfoSpan.get(0).asText();
			log.info("页面有错误提示！！！"+errorinfoSpanText);
			map.put("errorinfo", errorinfoSpanText);
			return map;
		}
		HtmlDivision alert_msg_box = (HtmlDivision) page.getElementById("alert_msg_box");
		if(alert_msg_box != null) {
			String style = alert_msg_box.getAttribute("style");
			if(!style.contains("none")) {
				HtmlDivision confirm_window = (HtmlDivision) alert_msg_box.getElementsByAttribute("div", "class", "confirm-window").get(0);
				String errorinfo = confirm_window.getElementsByTagName("p").get(0).asText();
				map.put("errorinfo", errorinfo);
				return map;
			}
		}
		for (int i = 0; i < timeoutmax; i++) {
			if(scl.URLsaveCommPassenger != null && alertMessage != null) {
				log.info("alertMessage===>"+alertMessage);
				map.put("msg", alertMessage);
				map.put("errorinfo", "null");
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("正在加载文件并保存......");
			}
		}
		return map;
	}
	
	/**
	 * 保存常用联系人（儿童）
	 */
	@Override
	public Map<String, Object> saveCommPassengerChild(String psgName, String psgFPNO, String cardType, String cardNum,
			String year, String month, String day, String phoneNum, String email) {
		scl.URLsaveCommPassenger = null;
		alertMessage = null;
		Map<String, Object> map = new HashMap<String ,Object>();
		HtmlPage page = addCommPassengerPage.getHtmlPage();
		HtmlInput radio1Input = (HtmlInput) page.getElementById("radio1");
		clickHandler(radio1Input);
		HtmlInput psgNameInput = (HtmlInput) page.getElementById("psgName");
		psgNameInput.setValueAttribute(psgName);
		HtmlInput psgFPNOInput = (HtmlInput) page.getElementById("psgFPNO");
		psgFPNOInput.setValueAttribute(psgFPNO);
		clickHandler(page.getElementById("idtypetext"));
		DomNodeList<HtmlElement> lis = page.getElementById("identityTypeUl").getElementsByTagName("li");
		for (int i = 0; i < lis.size(); i++) {
			String liVal = lis.get(i).getAttribute("val");
//			log.info("liVal===>"+liVal+",cardType===>"+cardType);
			if(cardType.equals(liVal)) {
				lis.get(i).focus();
				clickHandler(lis.get(i));
			}
		}
		HtmlInput idcardInput = (HtmlInput) page.getElementById("idcard");
		idcardInput.setValueAttribute(cardNum);
		
		clickHandler(page.getElementById("areselect2"));
		DomNodeList<HtmlElement> yearlis = page.getElementById("yesId").getElementsByTagName("li");
		for (int i = 0; i < yearlis.size(); i++) {
			String yearliVal = yearlis.get(i).asText();
//			log.info("liVal===>"+liVal+",cardType===>"+cardType);
			if(year.equals(yearliVal)) {
				clickHandler(yearlis.get(i));
			}
		}
		clickHandler(page.getElementById("areselect3"));
		DomNodeList<HtmlElement> monthlis = page.getElementById("monId").getElementsByTagName("li");
		for (int i = 0; i < monthlis.size(); i++) {
			String monthliVal = monthlis.get(i).asText();
//			log.info("liVal===>"+liVal+",cardType===>"+cardType);
			if(month.equals(monthliVal)) {
				clickHandler(monthlis.get(i));
			}
		}
		clickHandler(page.getElementById("areselect4"));
		DomNodeList<HtmlElement> daylis = page.getElementById("dayId").getElementsByTagName("li");
		for (int i = 0; i < daylis.size(); i++) {
			String dayliVal = daylis.get(i).asText();
//			log.info("liVal===>"+liVal+",cardType===>"+cardType);
			if(day.equals(dayliVal)) {
				clickHandler(daylis.get(i));
			}
		}
		HtmlInput psgPhoneInput = (HtmlInput) page.getElementById("psgPhone");
		psgPhoneInput.setValueAttribute(phoneNum);
		HtmlInput psgEmailInput = (HtmlInput) page.getElementById("psgEmail");
		psgEmailInput.setValueAttribute(email);
		HtmlInput usercookieIDInput = (HtmlInput) page.getElementById("usercookieID");
		clickHandler(usercookieIDInput);
		HtmlSpan saveBtn = (HtmlSpan) page.getBody().getElementsByAttribute("span", "class", "bn").get(0);
		clickHandler(saveBtn);
		List<HtmlElement> errorinfoSpan = page.getBody().getElementsByAttribute("span", "class", "errorinfo");
		if(errorinfoSpan.size() != 0) {
			String errorinfoSpanText = errorinfoSpan.get(0).asText();
			log.info("页面有错误提示！！！"+errorinfoSpanText);
			map.put("errorinfo", errorinfoSpanText);
			return map;
		}
		HtmlDivision alert_msg_box = (HtmlDivision) page.getElementById("alert_msg_box");
		if(alert_msg_box != null) {
			String style = alert_msg_box.getAttribute("style");
			log.info("style====>"+style);
			if(!style.contains("none")) {
				HtmlDivision confirm_window = (HtmlDivision) alert_msg_box.getElementsByAttribute("div", "class", "confirm-window").get(0);
				String errorinfo = confirm_window.getElementsByTagName("p").get(0).asText();
				map.put("errorinfo", errorinfo);
				HtmlButton btn_primary = (HtmlButton) page.getBody().getElementsByAttribute("button", "class", "btn btn-primary").get(0);
				clickHandler(btn_primary);
				return map;
			}
		}
		for (int i = 0; i < timeoutmax; i++) {
			if(scl.URLsaveCommPassenger != null && alertMessage != null) {
				log.info("alertMessage===>"+alertMessage);
				map.put("msg", alertMessage);
				map.put("errorinfo", "null");
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("正在加载文件并保存......");
			}
		}
		return map;
	}

	/**
	 * 保存常用旅客（婴儿）
	 */
	@Override
	public Map<String, Object> saveCommPassengerInfant(String psgName, String psgFPNO, String year, String month,
			String day, String phoneNum, String email) {
		scl.URLsaveCommPassenger = null;
		alertMessage = null;
		Map<String, Object> map = new HashMap<String ,Object>();
		HtmlPage page = addCommPassengerPage.getHtmlPage();
		HtmlInput radio2Input = (HtmlInput) page.getElementById("radio2");
		clickHandler(radio2Input);
		HtmlInput psgNameInput = (HtmlInput) page.getElementById("psgName");
		psgNameInput.setValueAttribute(psgName);
		HtmlInput psgFPNOInput = (HtmlInput) page.getElementById("psgFPNO");
		psgFPNOInput.setValueAttribute(psgFPNO);
		
		clickHandler(page.getElementById("areselect2"));
		DomNodeList<HtmlElement> yearlis = page.getElementById("yesId").getElementsByTagName("li");
		for (int i = 0; i < yearlis.size(); i++) {
			String yearliVal = yearlis.get(i).asText();
//			log.info("liVal===>"+liVal+",cardType===>"+cardType);
			if(year.equals(yearliVal)) {
				clickHandler(yearlis.get(i));
			}
		}
		clickHandler(page.getElementById("areselect3"));
		DomNodeList<HtmlElement> monthlis = page.getElementById("monId").getElementsByTagName("li");
		for (int i = 0; i < monthlis.size(); i++) {
			String monthliVal = monthlis.get(i).asText();
//			log.info("liVal===>"+liVal+",cardType===>"+cardType);
			if(month.equals(monthliVal)) {
				clickHandler(monthlis.get(i));
			}
		}
		clickHandler(page.getElementById("areselect4"));
		DomNodeList<HtmlElement> daylis = page.getElementById("dayId").getElementsByTagName("li");
		for (int i = 0; i < daylis.size(); i++) {
			String dayliVal = daylis.get(i).asText();
//			log.info("liVal===>"+liVal+",cardType===>"+cardType);
			if(day.equals(dayliVal)) {
				clickHandler(daylis.get(i));
			}
		}
		HtmlInput psgPhoneInput = (HtmlInput) page.getElementById("psgPhone");
		psgPhoneInput.setValueAttribute(phoneNum);
		HtmlInput psgEmailInput = (HtmlInput) page.getElementById("psgEmail");
		psgEmailInput.setValueAttribute(email);
		HtmlInput usercookieIDInput = (HtmlInput) page.getElementById("usercookieID");
		clickHandler(usercookieIDInput);
		HtmlSpan saveBtn = (HtmlSpan) page.getBody().getElementsByAttribute("span", "class", "bn").get(0);
		clickHandler(saveBtn);
		List<HtmlElement> errorinfoSpan = page.getBody().getElementsByAttribute("span", "class", "errorinfo");
		if(errorinfoSpan.size() != 0) {
			String errorinfoSpanText = errorinfoSpan.get(0).asText();
			log.info("页面有错误提示！！！"+errorinfoSpanText);
			map.put("errorinfo", errorinfoSpanText);
			return map;
		}
		HtmlDivision alert_msg_box = (HtmlDivision) page.getElementById("alert_msg_box");
		if(alert_msg_box != null) {
			String style = alert_msg_box.getAttribute("style");
			log.info("style====>"+style);
			if(!style.contains("none")) {
				HtmlDivision confirm_window = (HtmlDivision) alert_msg_box.getElementsByAttribute("div", "class", "confirm-window").get(0);
				String errorinfo = confirm_window.getElementsByTagName("p").get(0).asText();
				map.put("errorinfo", errorinfo);
				HtmlButton btn_primary = (HtmlButton) page.getBody().getElementsByAttribute("button", "class", "btn btn-primary").get(0);
				clickHandler(btn_primary);
				return map;
			}
		}
		for (int i = 0; i < timeoutmax; i++) {
			if(scl.URLsaveCommPassenger != null && alertMessage != null) {
				log.info("alertMessage===>"+alertMessage);
				map.put("msg", alertMessage);
				map.put("errorinfo", "null");
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("正在加载文件并保存......");
			}
		}
		return map;
	}
	
	/**
	 * 点击修改常用旅客
	 */
	@Override
	public Map<String, Object> checkEditPassenger(String passengerName, String domesticOrInternational,
			String passengerType, String cardNum) {
		scl.editCommPassengerPage = null;
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = commPassengerPage.getHtmlPage();
		List<HtmlElement> table_cells = page.getBody().getElementsByAttribute("div", "class", "table_cell");
		for (int i = 0; i < table_cells.size(); i++) {
			HtmlElement table_cell = table_cells.get(i);
			DomNodeList<HtmlElement> lis = table_cell.getElementsByTagName("li");
			String name = lis.get(0).asText();
			String doi = lis.get(1).asText();
			String type = lis.get(2).asText();
			String num = lis.get(3).asText();
			if(passengerName.equals(name) && domesticOrInternational.equals(doi) && passengerType.equals(type) && cardNum.equals(num)) {
				HtmlUnorderedList ul = (HtmlUnorderedList) table_cell.getElementsByTagName("ul").get(0);
				HtmlListItem liLast = (HtmlListItem) ul.getLastChild();
				HtmlAnchor aEdit = (HtmlAnchor) liLast.getElementsByAttribute("a", "class", "edit-info").get(0);
				clickHandler(aEdit);
				for (int j = 0; j < timeoutmax; j++) {
					if(scl.editCommPassengerPage != null) {
						editCommPassengerPage = webClient.getCsairHtmlPage(scl.editCommPassengerPage, "editCommPassengerPage", false);
						map.put("notice", "true");
						return map;
					}
					synchronized (page) {
						try {
							page.wait(1000);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						log.info("正在加载查看页面.....");
					}
				}
			}
		}
		return map;
	}
	
	/**
	 * 加载修改常用旅客页面
	 */
	@Override
	public Map<String, Object> loadEditPassenger() {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = editCommPassengerPage.getHtmlPage();
		for (int i = 0; i < timeoutmax; i++) {
			HtmlInput psgNameInput = (HtmlInput) page.getElementById("psgName");
			if(psgNameInput !=null) {
				String psgNameValue = psgNameInput.asText().trim();
				if(psgNameValue.length()!=0) {
					map.put("psgName", psgNameValue);
					HtmlInput radio1Input = (HtmlInput) page.getElementById("radio1");
					HtmlInput radio2Input = (HtmlInput) page.getElementById("radio2");
					String radio1InputChecked = radio1Input.getAttribute("checked");
					String radio2InputChecked = radio2Input.getAttribute("checked");
					if(radio1InputChecked.equals("checked")) {
						map.put("pType", "radio1");
					}else if(radio2InputChecked.equals("checked")) {
						map.put("pType", "radio2");
					}else {
						map.put("pType", "radio0");
					}
					String psgFPNO = page.getElementById("psgFPNO").asText().trim();
					map.put("psgFPNO", psgFPNO);
					String cardType = page.getElementById("idtypetext").asText().trim();
					map.put("cardType", cardType);
					String cardNum = page.getElementById("idcard").asText().trim();
					map.put("cardNum", cardNum);
					HtmlInput yearInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "name", "birthdayyear").get(0);
					String year = yearInput.getValueAttribute();
					map.put("year", year);
					HtmlInput monthInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "name", "birthdaymonth").get(0);
					String month = monthInput.getValueAttribute();
					map.put("month", month);
					HtmlInput dayInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "name", "birthdaydate").get(0);
					String day = dayInput.getValueAttribute();
					map.put("day", day);
					String phoneNum = page.getElementById("psgPhone").asText().trim();
					map.put("phoneNum", phoneNum);
					String email = page.getElementById("psgEmail").asText().trim();
					map.put("email", email);
					log.info("radio1InputChecked===>"+radio1InputChecked+",psgFPNO===>"+psgFPNO+",cardType===>"+cardType+",cardNum===>"+cardNum+",year===>"+year+",month===>"+month+",day===>"+day+",phoneNum"+phoneNum+",email"+email);
					return map;
				}
			}
			synchronized (page) {
				try {
					page.wait(800);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("修改页面加载中......");
			}
		}
		return map;
	}

	/**
	 * 修改常用旅客（成人）保存
	 */
	@Override
	public Map<String, Object> editCommPassengerAdult(String psgName, String psgFPNO, String cardType, String cardNum,
			String phoneNum, String email) {
		scl.URLsaveCommPassenger = null;
		alertMessage = null;
		Map<String, Object> map = new HashMap<String ,Object>();
		HtmlPage page = editCommPassengerPage.getHtmlPage();
		HtmlInput radio0Input = (HtmlInput) page.getElementById("radio0");
		clickHandler(radio0Input);
		HtmlInput psgNameInput = (HtmlInput) page.getElementById("psgName");
		psgNameInput.setValueAttribute(psgName);
		HtmlInput psgFPNOInput = (HtmlInput) page.getElementById("psgFPNO");
		psgFPNOInput.setValueAttribute(psgFPNO);
		clickHandler(page.getElementById("idtypetext"));
		DomNodeList<HtmlElement> lis = page.getElementById("identityTypeUl").getElementsByTagName("li");
		for (int i = 0; i < lis.size(); i++) {
			String liVal = lis.get(i).getAttribute("val");
//			log.info("liVal===>"+liVal+",cardType===>"+cardType);
			if(cardType.equals(liVal)) {
				lis.get(i).focus();
				clickHandler(lis.get(i));
			}
		}
		HtmlInput idcardInput = (HtmlInput) page.getElementById("idcard");
		idcardInput.setValueAttribute(cardNum);
		HtmlInput psgPhoneInput = (HtmlInput) page.getElementById("psgPhone");
		psgPhoneInput.setValueAttribute(phoneNum);
		HtmlInput psgEmailInput = (HtmlInput) page.getElementById("psgEmail");
		psgEmailInput.setValueAttribute(email);
		HtmlInput usercookieIDInput = (HtmlInput) page.getElementById("usercookieID");
		clickHandler(usercookieIDInput);
		HtmlSpan saveBtn = (HtmlSpan) page.getBody().getElementsByAttribute("span", "class", "bn").get(0);
		clickHandler(saveBtn);
		List<HtmlElement> errorinfoSpan = page.getBody().getElementsByAttribute("span", "class", "errorinfo");
		if(errorinfoSpan.size() != 0) {
			String errorinfoSpanText = errorinfoSpan.get(0).asText();
			log.info("页面有错误提示！！！"+errorinfoSpanText);
			map.put("errorinfo", errorinfoSpanText);
			return map;
		}
		HtmlDivision alert_msg_box = (HtmlDivision) page.getElementById("alert_msg_box");
		if(alert_msg_box != null) {
			String style = alert_msg_box.getAttribute("style");
			if(!style.contains("none")) {
				HtmlDivision confirm_window = (HtmlDivision) alert_msg_box.getElementsByAttribute("div", "class", "confirm-window").get(0);
				String errorinfo = confirm_window.getElementsByTagName("p").get(0).asText();
				map.put("errorinfo", errorinfo);
				return map;
			}
		}
		for (int i = 0; i < timeoutmax; i++) {
			if(scl.URLsaveCommPassenger != null && alertMessage != null) {
				log.info("alertMessage===>"+alertMessage);
				map.put("msg", alertMessage);
				map.put("errorinfo", "null");
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("正在加载文件并保存......");
			}
		}
		return map;
	}

	/**
	 * 修改常用旅客（儿童）保存
	 */
	@Override
	public Map<String, Object> editCommPassengerChild(String psgName, String psgFPNO, String cardType, String cardNum,
			String year, String month, String day, String phoneNum, String email) {
		scl.URLsaveCommPassenger = null;
		alertMessage = null;
		Map<String, Object> map = new HashMap<String ,Object>();
		HtmlPage page = editCommPassengerPage.getHtmlPage();
		HtmlInput radio1Input = (HtmlInput) page.getElementById("radio1");
		clickHandler(radio1Input);
		HtmlInput psgNameInput = (HtmlInput) page.getElementById("psgName");
		psgNameInput.setValueAttribute(psgName);
		HtmlInput psgFPNOInput = (HtmlInput) page.getElementById("psgFPNO");
		psgFPNOInput.setValueAttribute(psgFPNO);
		clickHandler(page.getElementById("idtypetext"));
		DomNodeList<HtmlElement> lis = page.getElementById("identityTypeUl").getElementsByTagName("li");
		for (int i = 0; i < lis.size(); i++) {
			String liVal = lis.get(i).getAttribute("val");
//			log.info("liVal===>"+liVal+",cardType===>"+cardType);
			if(cardType.equals(liVal)) {
				lis.get(i).focus();
				clickHandler(lis.get(i));
			}
		}
		HtmlInput idcardInput = (HtmlInput) page.getElementById("idcard");
		idcardInput.setValueAttribute(cardNum);
		
		clickHandler(page.getElementById("areselect2"));
		DomNodeList<HtmlElement> yearlis = page.getElementById("yesId").getElementsByTagName("li");
		for (int i = 0; i < yearlis.size(); i++) {
			String yearliVal = yearlis.get(i).asText();
//			log.info("liVal===>"+liVal+",cardType===>"+cardType);
			if(year.equals(yearliVal)) {
				clickHandler(yearlis.get(i));
			}
		}
		clickHandler(page.getElementById("areselect3"));
		DomNodeList<HtmlElement> monthlis = page.getElementById("monId").getElementsByTagName("li");
		for (int i = 0; i < monthlis.size(); i++) {
			String monthliVal = monthlis.get(i).asText();
//			log.info("liVal===>"+liVal+",cardType===>"+cardType);
			if(month.equals(monthliVal)) {
				clickHandler(monthlis.get(i));
			}
		}
		clickHandler(page.getElementById("areselect4"));
		DomNodeList<HtmlElement> daylis = page.getElementById("dayId").getElementsByTagName("li");
		for (int i = 0; i < daylis.size(); i++) {
			String dayliVal = daylis.get(i).asText();
//			log.info("liVal===>"+liVal+",cardType===>"+cardType);
			if(day.equals(dayliVal)) {
				clickHandler(daylis.get(i));
			}
		}
		HtmlInput psgPhoneInput = (HtmlInput) page.getElementById("psgPhone");
		psgPhoneInput.setValueAttribute(phoneNum);
		HtmlInput psgEmailInput = (HtmlInput) page.getElementById("psgEmail");
		psgEmailInput.setValueAttribute(email);
		HtmlInput usercookieIDInput = (HtmlInput) page.getElementById("usercookieID");
		clickHandler(usercookieIDInput);
		HtmlSpan saveBtn = (HtmlSpan) page.getBody().getElementsByAttribute("span", "class", "bn").get(0);
		clickHandler(saveBtn);
		List<HtmlElement> errorinfoSpan = page.getBody().getElementsByAttribute("span", "class", "errorinfo");
		if(errorinfoSpan.size() != 0) {
			String errorinfoSpanText = errorinfoSpan.get(0).asText();
			log.info("页面有错误提示！！！"+errorinfoSpanText);
			map.put("errorinfo", errorinfoSpanText);
			return map;
		}
		HtmlDivision alert_msg_box = (HtmlDivision) page.getElementById("alert_msg_box");
		if(alert_msg_box != null) {
			String style = alert_msg_box.getAttribute("style");
			log.info("style====>"+style);
			if(!style.contains("none")) {
				HtmlDivision confirm_window = (HtmlDivision) alert_msg_box.getElementsByAttribute("div", "class", "confirm-window").get(0);
				String errorinfo = confirm_window.getElementsByTagName("p").get(0).asText();
				map.put("errorinfo", errorinfo);
				HtmlButton btn_primary = (HtmlButton) page.getBody().getElementsByAttribute("button", "class", "btn btn-primary").get(0);
				clickHandler(btn_primary);
				return map;
			}
		}
		for (int i = 0; i < timeoutmax; i++) {
			if(scl.URLsaveCommPassenger != null && alertMessage != null) {
				log.info("alertMessage===>"+alertMessage);
				map.put("msg", alertMessage);
				map.put("errorinfo", "null");
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("正在加载文件并保存......");
			}
		}
		return map;
	}
	
	/**
	 * 修改常用旅客（婴儿）保存
	 */
	@Override
	public Map<String, Object> editCommPassengerInfant(String psgName, String psgFPNO, String year, String month,
			String day, String phoneNum, String email) {
		scl.URLsaveCommPassenger = null;
		alertMessage = null;
		Map<String, Object> map = new HashMap<String ,Object>();
		HtmlPage page = editCommPassengerPage.getHtmlPage();
		HtmlInput radio2Input = (HtmlInput) page.getElementById("radio2");
		clickHandler(radio2Input);
		HtmlInput psgNameInput = (HtmlInput) page.getElementById("psgName");
		psgNameInput.setValueAttribute(psgName);
		HtmlInput psgFPNOInput = (HtmlInput) page.getElementById("psgFPNO");
		psgFPNOInput.setValueAttribute(psgFPNO);
		
		clickHandler(page.getElementById("areselect2"));
		DomNodeList<HtmlElement> yearlis = page.getElementById("yesId").getElementsByTagName("li");
		for (int i = 0; i < yearlis.size(); i++) {
			String yearliVal = yearlis.get(i).asText();
//			log.info("liVal===>"+liVal+",cardType===>"+cardType);
			if(year.equals(yearliVal)) {
				clickHandler(yearlis.get(i));
			}
		}
		clickHandler(page.getElementById("areselect3"));
		DomNodeList<HtmlElement> monthlis = page.getElementById("monId").getElementsByTagName("li");
		for (int i = 0; i < monthlis.size(); i++) {
			String monthliVal = monthlis.get(i).asText();
//			log.info("liVal===>"+liVal+",cardType===>"+cardType);
			if(month.equals(monthliVal)) {
				clickHandler(monthlis.get(i));
			}
		}
		clickHandler(page.getElementById("areselect4"));
		DomNodeList<HtmlElement> daylis = page.getElementById("dayId").getElementsByTagName("li");
		for (int i = 0; i < daylis.size(); i++) {
			String dayliVal = daylis.get(i).asText();
//			log.info("liVal===>"+liVal+",cardType===>"+cardType);
			if(day.equals(dayliVal)) {
				clickHandler(daylis.get(i));
			}
		}
		HtmlInput psgPhoneInput = (HtmlInput) page.getElementById("psgPhone");
		psgPhoneInput.setValueAttribute(phoneNum);
		HtmlInput psgEmailInput = (HtmlInput) page.getElementById("psgEmail");
		psgEmailInput.setValueAttribute(email);
		HtmlInput usercookieIDInput = (HtmlInput) page.getElementById("usercookieID");
		clickHandler(usercookieIDInput);
		HtmlSpan saveBtn = (HtmlSpan) page.getBody().getElementsByAttribute("span", "class", "bn").get(0);
		clickHandler(saveBtn);
		List<HtmlElement> errorinfoSpan = page.getBody().getElementsByAttribute("span", "class", "errorinfo");
		if(errorinfoSpan.size() != 0) {
			String errorinfoSpanText = errorinfoSpan.get(0).asText();
			log.info("页面有错误提示！！！"+errorinfoSpanText);
			map.put("errorinfo", errorinfoSpanText);
			return map;
		}
		HtmlDivision alert_msg_box = (HtmlDivision) page.getElementById("alert_msg_box");
		if(alert_msg_box != null) {
			String style = alert_msg_box.getAttribute("style");
			if(!style.contains("none")) {
				HtmlDivision confirm_window = (HtmlDivision) alert_msg_box.getElementsByAttribute("div", "class", "confirm-window").get(0);
				String errorinfo = confirm_window.getElementsByTagName("p").get(0).asText();
				map.put("errorinfo", errorinfo);
				HtmlButton btn_primary = (HtmlButton) page.getBody().getElementsByAttribute("button", "class", "btn btn-primary").get(0);
				clickHandler(btn_primary);
				return map;
			}
		}
		for (int i = 0; i < timeoutmax; i++) {
			if(scl.URLsaveCommPassenger != null && alertMessage != null) {
				log.info("alertMessage===>"+alertMessage);
				map.put("msg", alertMessage);
				map.put("errorinfo", "null");
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("正在加载文件并保存......");
			}
		}
		return map;
	}
	
	/**
	 * 根据状态查询购票记录
	 */
	@Override
	public JSONObject findOrderByStatus(String status , String pageNum) {
		String QueryPlaneOrdersByStatus = null;
		try {
			QueryPlaneOrdersByStatus = Csair.URQueryPlaneOrdersAo1 + "groupflag=0&status="+status+"&page="+pageNum;
			CsairPage xml = webClient.getCsairJsonObjectPage(QueryPlaneOrdersByStatus);
			JSONObject a = xml.getJsonObject();
			return a;
		} catch (FailingHttpStatusCodeException | IOException e) {
			e.printStackTrace();
		}
		return null;
	}
	
	/**
	 * 默认查询变更记录
	 */
	@Override
	public JSONObject findChangeList(String pageNum) {
		scl.URLorderCN = null;
		try {
			String QueryChangeList = Csair.URQueryChangeList + "&page=" + pageNum;
			log.info("开始汉字化行程!!!!!");

			CsairPage page = webClient.getCsairJsonObjectPage(QueryChangeList);
			JSONObject a = page.getJsonObject();
			log.info(a);
			return a;
		} catch (FailingHttpStatusCodeException | IOException e) {
			e.printStackTrace();
		}
		return null;
	}

	/**
	 * 根据状态查询变更记录
	 */
	@Override
	public JSONObject findChangeListByStatus(String status, String pageNum) {
		String QueryChangeListByStatus = null;
		try {
			QueryChangeListByStatus = Csair.URQueryChangeList1 + "?chgstatus="+status+"&page=" + pageNum;
			CsairPage xml = webClient.getCsairJsonObjectPage(QueryChangeListByStatus);
			JSONObject a = xml.getJsonObject();
			log.info(a);
			return a;
		} catch (FailingHttpStatusCodeException | IOException e) {
			e.printStackTrace();
		}
		return null;
	}

	/**
	 * 默认查询退票记录
	 */
	@Override
	public JSONObject findRefundList(String pageNum) {
		scl.URLorderCN = null;
		try {
			String QueryRefundList = Csair.URQueryRefundList;
			log.info("开始汉字化行程!!!!!");
			HtmlPage b = webClient.getPage(QueryRefundList);
			JSONObject a = JSONObject.fromObject(b.getBody().asText());
			log.info(a);
			return a;
		} catch (FailingHttpStatusCodeException | IOException e) {
			e.printStackTrace();
		}
		return null;
	}

	/**
	 * 根据状态查询退票记录
	 */
	@Override
	public JSONObject findRefundListByStatus(String status, String pageNum) {
		String QueryRefundListByStatus = null;
		try {
			QueryRefundListByStatus = Csair.URQueryRefundList1 + "?rfdstatus="+status+"&page="+pageNum;
			HtmlPage b = webClient.getPage(QueryRefundListByStatus);
			JSONObject a = JSONObject.fromObject(b.getBody().asText());
			log.info(a);
			return a;
		} catch (FailingHttpStatusCodeException | IOException e) {
			e.printStackTrace();
		}
		return null;
	}
	
	
	/**
	 * 加载单程里程兑换页面
	 */
	@Override
	public Map<String, Object> lcExchangeList(String c1, String c2, String date, int year, int month, int day,
			int year2, int month2, int day2) {
		Map<String, Object> map = new HashMap<String, Object>();
		List<LcExchangeFlight> lcExchangeFlights = new ArrayList<LcExchangeFlight>();
		List<LcTableInfo> lcTableInfos = new ArrayList<LcTableInfo>();
		URLlcExchangeListPage= Csair.lcExchangePage + "?t=S&c1=" + c1 + "&c2=" + c2 + "&d1=" + date +"&at=1&ct=0&it=0" ;
		log.info("URLlcExchangeListPage====>"+URLlcExchangeListPage);
		if (lcExchangeListPage.isNull() == Boolean.FALSE) {
			lcExchangeListPage.setHtmlPage(null);
		}
		log.info("获取航班查询网址");
		long t1 = System.currentTimeMillis();
		lcExchangeListPage = webClient.getCsairHtmlPage(URLlcExchangeListPage, "URLlcExchangeListPage", false);

		HtmlPage page = lcExchangeListPage.getHtmlPage();
		for (int j = 0; j <= timeoutmax; j++) {
			HtmlDivision confirmDiv = page.getFirstByXPath("//div[@class='confirm2-licheng']");
			if(confirmDiv !=null){
				log.info("售罄提示框！！！");
				long t2 = System.currentTimeMillis();
				map.put("errorAlert", "当天无南航航班或座位已售罄！");
				map.put("cf", c1);
				map.put("dd", c2);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				map.put("t1", t1);
				map.put("t2", t2);
				return map;
			}
			HtmlDivision alert_error = page.getFirstByXPath("//div[@class='alert-info alert-error']");
			HtmlDivision alert_error1 = page.getFirstByXPath("//div[@class='alertinfo-error']");
			
			if (alert_error != null || alert_error1 != null) {
				long t2 = System.currentTimeMillis();
				map.put("cf", c1);
				map.put("dd", c2);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				HtmlDivision qc = page.getFirstByXPath("//div[@class='flightTcity']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='flightTTime']");
				
				map.put("qc", qc.asText());// 全程
				map.put("rq", rq.asText());// 日期

				HtmlDivision lk = page.getFirstByXPath("//div[@class='flightTdata']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span.spaceO");
				String adult = lkelments.get(0).text();
				map.put("adult", adult);
				if(alert_error != null){
					map.put("noflight", alert_error.asText());
				}
				if(alert_error1 != null){
					map.put("noflight1", alert_error1.asText());
				}
				
				map.put("t1", t1);
				map.put("t2", t2);
				return map;
			}
		
			HtmlUnorderedList ul = page.getFirstByXPath("//ul[@class='sp-trip-body']");
			HtmlDivision tbl = page.getFirstByXPath("//div[@class='licheng-tbl clearfix']");
			if (scl.URLlcExchangeList != null && ul != null && tbl != null) {
				long t2 = System.currentTimeMillis();
				map.put("cf", c1);
				map.put("dd", c2);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				String buyer = page.getElementById("buyer-licheng").asText();
				String avail = page.getElementById("avail-licheng").asText();//可消费里程
				String overdraft = page.getElementById("overdraft-licheng").asText();//可透支里程
				map.put("buyer", buyer);
				map.put("avail", avail);
				map.put("overdraft", overdraft);
				
				DomNodeList<HtmlElement> trs = tbl.getElementsByTagName("tr");
				for (int i = 1; i < trs.size(); i++) {
					HtmlElement tr = trs.get(i);
					String trStyle = tr.getAttribute("style");
					if(!trStyle.contains("none")) {
						LcTableInfo lcTableInfo = new LcTableInfo();
						DomNodeList<HtmlElement> tds = tr.getElementsByTagName("td");
						String cangWei = tds.get(0).asText();
						String cuXiaoLiCheng = tds.get(1).asText();
						String changGuiLiCheng = tds.get(2).getElementsByTagName("label").get(0).asText();
						lcTableInfo.setCangWei(cangWei);
						lcTableInfo.setCuXiaoLiCheng(cuXiaoLiCheng);
						lcTableInfo.setChangGuiLiCheng(changGuiLiCheng);
						lcTableInfos.add(lcTableInfo);
					}
				}
				map.put("lcTableInfos", lcTableInfos);
				
				HtmlDivision qc = page.getFirstByXPath("//div[@class='flightTcity']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='flightTTime']");
				log.info("qc==>"+qc);
				log.info("rq==>"+rq);
				map.put("qc", qc.asText());
				map.put("rq", rq.asText());

				HtmlDivision lk = page.getFirstByXPath("//div[@class='flightTdata']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span.spaceO");
				String adult = lkelments.get(0).text();
				map.put("adult", adult);

				Document document = Jsoup.parse(ul.asXml());
				Elements lis = document.select("li.showf");
				for (int i = 0; i < lis.size(); i++) {
					LcExchangeFlight f = new LcExchangeFlight();
					Element li = lis.get(i);
					if (li != null) {
						Element doc = li;
						// 起飞时间
						f.qf_time = doc.select("div.sp-trip-time").get(0).text().trim();
						// 起飞城市
						f.qf_city = doc.select("div.sp-trip-city").get(0).text().trim();
						// 到达时间
						f.dd_time = doc.select("div.sp-trip-time").get(1).text().trim();
						// 到达城市
						f.dd_city = doc.select("div.sp-trip-city").get(1).text().trim();
						// 航班号
						f.hbh = doc.select("div.sp-trip-stops").get(0).text().trim();
						// 飞机型号
						f.jx = doc.select("div.sp-trip-duration").get(0).text().trim();
						//剩余座位数
						f.seat = doc.select("span.showf").get(0).text().trim(); 
						//详情href
						f.details_id = doc.select("div.sp-trip-intre a").attr("aria-controls");
						//单选框data-href
						f.data_href = doc.select(".sp-cabin-cell1").attr("data-href");
					}
					lcExchangeFlights.add(f);
				}
				map.put("lcExchangeFlights", lcExchangeFlights);
				
				String flightMileageCount = page.getElementById("flightMileageCount").asText();
				String flightMileageCondi = page.getElementById("flightMileageCondi").asText();
				map.put("flightMileageCount", flightMileageCount);
				map.put("flightMileageCondi", flightMileageCondi);
				
				map.put("t1", t1);
				map.put("t2", t2);
				scl.URLlcExchangeList = null;
				scl.URLflightWF = null;
				
				break;
			}
			synchronized (page) {
				try {
					page.wait(1000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("里程兑换页面加载中.......");
			}
		}
		for (int j = 0; j <= timeoutmax; j++) {
			HtmlDivision rls = page.getFirstByXPath("//div[@class='flightweek clearfix']");
			List<Kalendar> kalendars = new ArrayList<Kalendar>();
			if (rls != null) {
				Document document = Jsoup.parse(rls.asXml());
				Elements elements = document.select("ul li");
				for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
					Element li = (Element) iterator.next();
					Kalendar k = new Kalendar();
					k.id = li.attr("data-date").trim();
//					log.info("cls:" + k.id);
					String cls = li.attr("class");
					if (cls != null && cls.trim().equals("") != true) {
						k.current = cls.trim();
					}
					k.week = li.select("a.weekBtn").get(0).ownText();
					k.date = li.select("span.spaceO").get(0).ownText();
					k.price = li.select("div.weekprice").get(0).ownText();
//					log.info(k);
					kalendars.add(k);
				}
				map.put("kalendars", kalendars);
				break;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
		return map;
	}
	
	/**
	 * 加载往返里程兑换页面
	 */
	@Override
	public Map<String, Object> lcExchangeList2(String c1, String c2, String date,String date2, int year, int month, int day,
			int year2, int month2, int day2) {
		Map<String, Object> map = new HashMap<String, Object>();
		List<LcTableInfo> lcTableInfos = new ArrayList<LcTableInfo>();
		List<LcExchangeFlight> lcExchangeFlights = new ArrayList<LcExchangeFlight>();
		List<LcExchangeFlight2> lcExchangeFlights2 = new ArrayList<LcExchangeFlight2>();
		URLlcExchangeListPage= Csair.lcExchangePage + "?t=R&c1=" + c1 + "&c2=" + c2 + "&d1=" + date + "&d2=" + date2 +"&at=1&ct=0&it=0" ;
		log.info("URLlcExchangeListPage====>"+URLlcExchangeListPage);
		if (lcExchangeListPage.isNull() == Boolean.FALSE) {
			lcExchangeListPage.setHtmlPage(null);
		}
		log.info("获取航班查询网址");
		long t1 = System.currentTimeMillis();
		lcExchangeListPage = webClient.getCsairHtmlPage(URLlcExchangeListPage, "URLlcExchangeListPage", false);

		HtmlPage page = lcExchangeListPage.getHtmlPage();
		for (int j = 0; j <= timeoutmax; j++) {
			HtmlDivision confirmDiv = page.getFirstByXPath("//div[@class='confirm2-licheng']");
			if(confirmDiv !=null){
				long t2 = System.currentTimeMillis();
				map.put("errorAlert", "当天无南航航班或座位已售罄！");
				map.put("cf", c1);
				map.put("dd", c2);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				map.put("t1", t1);
				map.put("t2", t2);
				return map;
			}
			HtmlDivision alert_error = page.getFirstByXPath("//div[@class='alert-info alert-error']");
			HtmlDivision alert_error1 = page.getFirstByXPath("//div[@class='alertinfo-error']");
			
			if (alert_error != null || alert_error1 != null) {
				long t2 = System.currentTimeMillis();
				map.put("cf", c1);
				map.put("dd", c2);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				HtmlDivision qc = page.getFirstByXPath("//div[@class='flightTcity']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='flightTTime']");
				
				map.put("qc", qc.asText());// 全程
				map.put("rq", rq.asText());// 日期

				HtmlDivision lk = page.getFirstByXPath("//div[@class='flightTdata']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span.spaceO");
				String adult = lkelments.get(0).text();
				map.put("adult", adult);
				if(alert_error != null){
					map.put("noflight", alert_error.asText());
				}
				if(alert_error1 != null){
					map.put("noflight1", alert_error1.asText());
				}
				
				map.put("t1", t1);
				map.put("t2", t2);
				return map;
			}
		
			
			List<HtmlElement> uls = page.getBody().getElementsByAttribute("ul", "class", "sp-trip-body");
			HtmlDivision tbl = page.getFirstByXPath("//div[@class='licheng-tbl clearfix']");
			if (uls.size() > 1 && tbl != null) {
				long t2 = System.currentTimeMillis();
				map.put("cf", c1);
				map.put("dd", c2);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				String buyer = page.getElementById("buyer-licheng").asText();
				String avail = page.getElementById("avail-licheng").asText();//可消费里程
				String overdraft = page.getElementById("overdraft-licheng").asText();//可透支里程
				map.put("buyer", buyer);
				map.put("avail", avail);
				map.put("overdraft", overdraft);
				
				DomNodeList<HtmlElement> trs = tbl.getElementsByTagName("tr");
				for (int i = 1; i < trs.size(); i++) {
					HtmlElement tr = trs.get(i);
					String trStyle = tr.getAttribute("style");
					if(!trStyle.contains("none")) {
						LcTableInfo lcTableInfo = new LcTableInfo();
						DomNodeList<HtmlElement> tds = tr.getElementsByTagName("td");
						String cangWei = tds.get(0).asText();
						String cuXiaoLiCheng = tds.get(1).asText();
						String changGuiLiCheng = tds.get(2).getElementsByTagName("label").get(0).asText();
						lcTableInfo.setCangWei(cangWei);
						lcTableInfo.setCuXiaoLiCheng(cuXiaoLiCheng);
						lcTableInfo.setChangGuiLiCheng(changGuiLiCheng);
						lcTableInfos.add(lcTableInfo);
					}
				}
				map.put("lcTableInfos", lcTableInfos);
				
				HtmlDivision qc = page.getFirstByXPath("//div[@class='flightTcity']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='flightTTime']");
				HtmlDivision cityName = page.getFirstByXPath("//div[@class='flightTcityname']");
				log.info("qc==>"+qc);
				log.info("rq==>"+rq);
				log.info("cityName==>"+cityName);
				map.put("qc", qc.asText());
				map.put("rq", rq.asText());
				map.put("cityName", cityName.asText());
				
				HtmlDivision lk = page.getFirstByXPath("//div[@class='flightTdata']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span.spaceO");
				String adult = lkelments.get(0).text();
				map.put("adult", adult);

				HtmlUnorderedList ul = page.getFirstByXPath("//ul[@class='sp-trip-body']");
				Document document = Jsoup.parse(ul.asXml());
				Elements lis = document.select("li.showf");
				for (int i = 0; i < lis.size(); i++) {
					LcExchangeFlight f = new LcExchangeFlight();
					Element li = lis.get(i);
					if (li != null) {
						Element doc = li;
						// 起飞时间
						f.qf_time = doc.select("div.sp-trip-time").get(0).text().trim();
						// 起飞城市
						f.qf_city = doc.select("div.sp-trip-city").get(0).text().trim();
						// 到达时间
						f.dd_time = doc.select("div.sp-trip-time").get(1).text().trim();
						// 到达城市
						f.dd_city = doc.select("div.sp-trip-city").get(1).text().trim();
						// 航班号
						f.hbh = doc.select("div.sp-trip-stops").get(0).text().trim();
						// 飞机型号
						f.jx = doc.select("div.sp-trip-duration").get(0).text().trim();
						//剩余座位数
						f.seat = doc.select("span.showf").get(0).text().trim(); 
						//详情href
						f.details_id = doc.select("div.sp-trip-intre a").attr("aria-controls");
						//单选框data-href
						f.data_href = doc.select(".sp-cabin-cell1").attr("data-href");
					}
					lcExchangeFlights.add(f);
				}
				
				HtmlDivision qc2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTcity").get(1);
				HtmlDivision rq2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTTime").get(1);
				HtmlDivision cityName2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTcityname").get(1);
				log.info("qc2==>"+qc2);
				log.info("rq2==>"+rq2);
				log.info("cityName2==>"+cityName2);
				map.put("qc2", qc2.asText());
				map.put("rq2", rq2.asText());
				map.put("cityName2", cityName2.asText());

				HtmlDivision lk2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTdata").get(1);
				Document lk2doc = Jsoup.parse(lk2.asXml());
				Elements lk2elments = lk2doc.select("span.spaceO");
				String adult2 = lk2elments.get(0).text();
				map.put("adult2", adult2);
				
				
				HtmlUnorderedList ul2 = (HtmlUnorderedList) uls.get(1);
				Document document2 = Jsoup.parse(ul2.asXml());
				Elements li2s = document2.select("li.choose");
				for (int i = 0; i < li2s.size(); i++) {
					LcExchangeFlight2 f2 = new LcExchangeFlight2();
					Element li = li2s.get(i);
					if (li != null) {
						Element doc = li;
						// 起飞时间
						f2.qf_time = doc.select("div.sp-trip-time").get(0).text().trim();
						// 起飞城市
						f2.qf_city = doc.select("div.sp-trip-city").get(0).text().trim();
						// 到达时间
						f2.dd_time = doc.select("div.sp-trip-time").get(1).text().trim();
						// 到达城市
						f2.dd_city = doc.select("div.sp-trip-city").get(1).text().trim();
						// 航班号
						f2.hbh = doc.select("div.sp-trip-stops").get(0).text().trim();
						// 飞机型号
						f2.jx = doc.select("div.sp-trip-duration").get(0).text().trim();
						//剩余座位数
						f2.seat = doc.select("span.choose").get(0).text().trim(); 
						//详情href
						f2.details_id = doc.select("div.sp-trip-intre a").attr("aria-controls");
						//单选框data-href
						f2.data_href = doc.select(".sp-cabin-cell1").attr("data-href");
					}
					lcExchangeFlights2.add(f2);
				}
				map.put("lcExchangeFlights", lcExchangeFlights);
				map.put("lcExchangeFlights2", lcExchangeFlights2);
				
				String flightMileageCount = page.getElementById("flightMileageCount").asText();
				String flightMileageCondi = page.getElementById("flightMileageCondi").asText();
				map.put("flightMileageCount", flightMileageCount);
				map.put("flightMileageCondi", flightMileageCondi);
				
				map.put("t1", t1);
				map.put("t2", t2);
				scl.URLlcExchangeList = null;
				scl.URLflightWF = null;
				
				break;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("里程兑换页面加载中.......");
			}
		}
		for (int j = 0; j <= timeoutmax; j++) {
			HtmlDivision rls = page.getFirstByXPath("//div[@class='flightweek clearfix']");
			HtmlDivision rl2s = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightweek clearfix").get(1);
			List<Kalendar> kalendars = new ArrayList<Kalendar>();
			List<Kalendar2> kalendars2 = new ArrayList<Kalendar2>();
			if (rls != null && rl2s != null) {
				Document document = Jsoup.parse(rls.asXml());
				Elements elements = document.select("ul li");
				for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
					Element li = (Element) iterator.next();
					Kalendar k = new Kalendar();
					k.id = li.attr("data-date").trim();
//					log.info("cls:" + k.id);
					String cls = li.attr("class");
					if (cls != null && cls.trim().equals("") != true) {
						k.current = cls.trim();
					}
					k.week = li.select("a.weekBtn").get(0).ownText();
					k.date = li.select("span.spaceO").get(0).ownText();
					k.price = li.select("div.weekprice").get(0).ownText();
//					log.info(k);
					kalendars.add(k);
				}
				
				Document document2 = Jsoup.parse(rl2s.asXml());
				Elements elements2 = document2.select("ul li");
				for (Iterator<Element> iterator = elements2.iterator(); iterator.hasNext();) {
					Element li = (Element) iterator.next();
					Kalendar2 k2 = new Kalendar2();
					k2.id = li.attr("data-date").trim();
//					log.info("cls:" + k.id);
					String cls = li.attr("class");
					if (cls != null && cls.trim().equals("") != true) {
						k2.current = cls.trim();
					}
					k2.week = li.select("a.weekBtn").get(0).ownText();
					k2.date = li.select("span.spaceO").get(0).ownText();
					k2.price = li.select("div.weekprice").get(0).ownText();
//					log.info(k);
					kalendars2.add(k2);
				}
				map.put("kalendars", kalendars);
				map.put("kalendars2", kalendars2);
				break;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
		return map;
	}

	
	
	
	
	/**
	 * 里程兑换显示详情
	 * @param id
	 * @return
	 */
	@Override
	public Map<String, Object> getDiv1(String id) {
		log.info("方法中的id---->" + id);
		Map<String, Object> map = new HashMap<String ,Object>();
		HtmlPage page = lcExchangeListPage.getHtmlPage();
		HtmlAnchor a = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "aria-controls", id).get(0);
		clickHandler(a);
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision detailsDiv = (HtmlDivision) page.getElementById(id);
			List<HtmlElement> sp_seg_boxs = detailsDiv.getElementsByAttribute("div", "class", "sp-seg-box");
			if(sp_seg_boxs.size() != 0) {
				HtmlDivision sp_seg_box = (HtmlDivision) sp_seg_boxs.get(0);
				Document doc = Jsoup.parse(sp_seg_box.asXml());
				String sendTime = doc.select(".sp-seg-line .seg-dep .time").text().trim();
				map.put("sendTime", sendTime);
				String sendPlace = doc.select(".sp-seg-line .seg-dep .airport").text().trim();
				map.put("sendPlace", sendPlace);
				String arrTime = doc.select(".sp-seg-line .seg-arr .time").text().trim();
				map.put("arrTime", arrTime);
				String arrPlace = doc.select(".sp-seg-line .seg-arr .airport").text().trim();
				map.put("arrPlace", arrPlace);
				String jingTing = doc.select(".sp-seg-line .seg-label .stopnumber").text().trim();
				map.put("jingTing", jingTing);
				String flightCode = doc.select(".sp-seg-line .seg-info .plane .flight-code").text().trim();
				map.put("flightCode", flightCode);
				String planeName = doc.select(".sp-seg-line .seg-info .plane .plane-name").text().trim();
				map.put("planeName", planeName);
				String flightTime = doc.select(".sp-seg-duration strong").text().trim();
				map.put("flightTime", flightTime);
				return map;
			}
		}
		
		return map;
	}
	
	/**
	 * 往返里程兑换显示详情
	 */
	@Override
	public Map<String, Object> getDiv2(String id) {
		log.info("方法中的id---->" + id);
		Map<String, Object> map = new HashMap<String ,Object>();
		HtmlPage page = lcExchangeListPage.getHtmlPage();
		HtmlAnchor a = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "aria-controls", id).get(0);
		clickHandler(a);
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision detailsDiv = (HtmlDivision) page.getElementById(id);
			List<HtmlElement> sp_seg_boxs = detailsDiv.getElementsByAttribute("div", "class", "sp-seg-box1");
			if(sp_seg_boxs.size() != 0) {
				HtmlDivision sp_seg_box = (HtmlDivision) sp_seg_boxs.get(0);
				Document doc = Jsoup.parse(sp_seg_box.asXml());
				String sendTime = doc.select(".sp-seg-line1 .seg-dep .time").text().trim();
				map.put("sendTime", sendTime);
				String sendPlace = doc.select(".sp-seg-line1 .seg-dep .airport").text().trim();
				map.put("sendPlace", sendPlace);
				String arrTime = doc.select(".sp-seg-line1 .seg-arr .time").text().trim();
				map.put("arrTime", arrTime);
				String arrPlace = doc.select(".sp-seg-line1 .seg-arr .airport").text().trim();
				map.put("arrPlace", arrPlace);
				String jingTing = doc.select(".sp-seg-line1 .seg-label .stopnumber").text().trim();
				map.put("jingTing", jingTing);
				String flightCode = doc.select(".sp-seg-line1 .seg-info .plane .flight-code").text().trim();
				map.put("flightCode", flightCode);
				String planeName = doc.select(".sp-seg-line1 .seg-info .plane .plane-name").text().trim();
				map.put("planeName", planeName);
				String flightTime = doc.select(".sp-seg-duration1 strong").text().trim();
				map.put("flightTime", flightTime);
				return map;
			}
		}
		
		return map;
	}

	
	
	
	/**
	 * 里程兑换单程日历
	 * @param id
	 * @param cf
	 * @param dd
	 * @param year
	 * @param month
	 * @param day
	 * @param day2 
	 * @param month2 
	 * @param year2 
	 * @return
	 */
	@Override
	public Map<String, Object> lcExchangeListEx(String id, String cf, String dd, String year, String month,
			String day, String year2, String month2, String day2) {
		Map<String, Object> map = new HashMap<String, Object>();
		List<LcExchangeFlight> lcExchangeFlights = new ArrayList<LcExchangeFlight>();
		List<LcTableInfo> lcTableInfos = new ArrayList<LcTableInfo>();
		HtmlPage page = lcExchangeListPage.getHtmlPage();
		HtmlElement he = page.getFirstByXPath("//li[@data-date='" + id + "']");
		clickHandler(he);
		for (int j = 0; j <= timeoutmax; j++) {
			HtmlDivision confirmDiv = page.getFirstByXPath("//div[@class='confirm2-licheng']");
			if(confirmDiv !=null){
				map.put("errorAlert", "当天无南航航班或座位已售罄！");
				map.put("cf", cf);
				map.put("dd", dd);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				return map;
			}
			HtmlDivision alert_error = page.getFirstByXPath("//div[@class='alert-info alert-error']");
			HtmlDivision alert_error1 = page.getFirstByXPath("//div[@class='alertinfo-error']");
			
			if (alert_error != null || alert_error1 != null) {
				map.put("cf", cf);
				map.put("dd", dd);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				HtmlDivision qc = page.getFirstByXPath("//div[@class='flightTcity']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='flightTTime']");
				
				map.put("qc", qc.asText());// 全程
				map.put("rq", rq.asText());// 日期

				HtmlDivision lk = page.getFirstByXPath("//div[@class='flightTdata']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span.spaceO");
				String adult = lkelments.get(0).text();
				map.put("adult", adult);
				if(alert_error != null){
					map.put("noflight", alert_error.asText());
				}
				if(alert_error1 != null){
					map.put("noflight1", alert_error1.asText());
				}
				
				return map;
			}
			
			HtmlUnorderedList ul = page.getFirstByXPath("//ul[@class='sp-trip-body']");
			HtmlDivision tbl = page.getFirstByXPath("//div[@class='licheng-tbl clearfix']");
			if (scl.URLlcExchangeList != null && ul != null && tbl != null) {
				map.put("cf", cf);
				map.put("dd", dd);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);
				
				String buyer = page.getElementById("buyer-licheng").asText();
				String avail = page.getElementById("avail-licheng").asText();//可消费里程
				String overdraft = page.getElementById("overdraft-licheng").asText();//可透支里程
				map.put("buyer", buyer);
				map.put("avail", avail);
				map.put("overdraft", overdraft);
				
				DomNodeList<HtmlElement> trs = tbl.getElementsByTagName("tr");
				for (int i = 1; i < trs.size(); i++) {
					HtmlElement tr = trs.get(i);
					String trStyle = tr.getAttribute("style");
					if(!trStyle.contains("none")) {
						LcTableInfo lcTableInfo = new LcTableInfo();
						DomNodeList<HtmlElement> tds = tr.getElementsByTagName("td");
						String cangWei = tds.get(0).asText();
						String cuXiaoLiCheng = tds.get(1).asText();
						String changGuiLiCheng = tds.get(2).getElementsByTagName("label").get(0).asText();
						lcTableInfo.setCangWei(cangWei);
						lcTableInfo.setCuXiaoLiCheng(cuXiaoLiCheng);
						lcTableInfo.setChangGuiLiCheng(changGuiLiCheng);
						lcTableInfos.add(lcTableInfo);
					}
				}
				map.put("lcTableInfos", lcTableInfos);

				HtmlDivision qc = page.getFirstByXPath("//div[@class='flightTcity']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='flightTTime']");
				log.info("qc==>"+qc);
				map.put("qc", qc.asText());
				map.put("rq", rq.asText());

				HtmlDivision lk = page.getFirstByXPath("//div[@class='flightTdata']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span.spaceO");
				String adult = lkelments.get(0).text();
				map.put("adult", adult);

				Document document = Jsoup.parse(ul.asXml());
				Elements lis = document.select("li.showf");
				for (int i = 0; i < lis.size(); i++) {
					LcExchangeFlight f = new LcExchangeFlight();
					Element li = lis.get(i);
					if (li != null) {
						Element doc = li;
						// 起飞时间
						f.qf_time = doc.select("div.sp-trip-time").get(0).text().trim();
						// 起飞城市
						f.qf_city = doc.select("div.sp-trip-city").get(0).text().trim();
						// 到达时间
						f.dd_time = doc.select("div.sp-trip-time").get(1).text().trim();
						// 到达城市
						f.dd_city = doc.select("div.sp-trip-city").get(1).text().trim();
						// 航班号
						f.hbh = doc.select("div.sp-trip-stops").get(0).text().trim();
						// 飞机型号
						f.jx = doc.select("div.sp-trip-duration").get(0).text().trim();
						//剩余座位数
						f.seat = doc.select("span.showf").get(0).text().trim(); 
						//详情href
						f.details_id = doc.select("div.sp-trip-intre a").attr("aria-controls");
					}
					lcExchangeFlights.add(f);
				}
				map.put("lcExchangeFlights", lcExchangeFlights);
				
				String flightMileageCount = page.getElementById("flightMileageCount").asText();
				String flightMileageCondi = page.getElementById("flightMileageCondi").asText();
				map.put("flightMileageCount", flightMileageCount);
				map.put("flightMileageCondi", flightMileageCondi);
				
				scl.URLlcExchangeList = null;
				scl.URLflightWF = null;
				
				break;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
		for (int j = 0; j <= timeoutmax; j++) {
			HtmlDivision rls = page.getFirstByXPath("//div[@class='flightweek clearfix']");
			List<Kalendar> kalendars = new ArrayList<Kalendar>();
			if (rls != null) {
				Document document = Jsoup.parse(rls.asXml());
				Elements elements = document.select("ul li");
				for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
					Element li = (Element) iterator.next();
					Kalendar k = new Kalendar();
					k.id = li.attr("data-date").trim();
//					log.info("cls:" + k.id);
					String cls = li.attr("class");
					if (cls != null && cls.trim().equals("") != true) {
						k.current = cls.trim();
					}
					k.week = li.select("a.weekBtn").get(0).ownText();
					k.date = li.select("span.spaceO").get(0).ownText();
					k.price = li.select("div.weekprice").get(0).ownText();
//					log.info(k);
					kalendars.add(k);
				}
				map.put("kalendars", kalendars);
				break;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
		return map;
	}
	
	/**
	 * 里程兑换往返日历1
	 */
	@Override
	public Map<String, Object> lcExchangeListEx1(String id, String cf, String dd, String year, String month, String day,
			String year2, String month2, String day2) {
		Map<String, Object> map = new HashMap<String, Object>();
		List<LcExchangeFlight> lcExchangeFlights = new ArrayList<LcExchangeFlight>();
		List<LcExchangeFlight2> lcExchangeFlights2 = new ArrayList<LcExchangeFlight2>();
		List<LcTableInfo> lcTableInfos = new ArrayList<LcTableInfo>();
		long t1 = System.currentTimeMillis();
		HtmlPage page = lcExchangeListPage.getHtmlPage();
		HtmlElement he = page.getFirstByXPath("//li[@data-date='" + id + "']");
		clickHandler(he);
		for (int j = 0; j <= timeoutmax; j++) {
			HtmlDivision confirmDiv = page.getFirstByXPath("//div[@class='confirm2-licheng']");
			if(confirmDiv !=null){
				long t2 = System.currentTimeMillis();
				map.put("errorAlert", "当天无南航航班或座位已售罄！");
				map.put("cf", cf);
				map.put("dd", dd);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				map.put("t1", t1);
				map.put("t2", t2);
				return map;
			}
			HtmlDivision alert_error = page.getFirstByXPath("//div[@class='alert-info alert-error']");
			HtmlDivision alert_error1 = page.getFirstByXPath("//div[@class='alertinfo-error']");
			
			if (alert_error != null || alert_error1 != null) {
				long t2 = System.currentTimeMillis();
				map.put("cf", cf);
				map.put("dd", dd);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				HtmlDivision qc = page.getFirstByXPath("//div[@class='flightTcity']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='flightTTime']");
				
				map.put("qc", qc.asText());// 全程
				map.put("rq", rq.asText());// 日期

				HtmlDivision lk = page.getFirstByXPath("//div[@class='flightTdata']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span.spaceO");
				String adult = lkelments.get(0).text();
				map.put("adult", adult);
				if(alert_error != null){
					map.put("noflight", alert_error.asText());
				}
				if(alert_error1 != null){
					map.put("noflight1", alert_error1.asText());
				}
				
				map.put("t1", t1);
				map.put("t2", t2);
				return map;
			}
		
			
			List<HtmlElement> uls = page.getBody().getElementsByAttribute("ul", "class", "sp-trip-body");
			HtmlDivision tbl = page.getFirstByXPath("//div[@class='licheng-tbl clearfix']");
			if (uls.size() > 1 && tbl != null) {
				long t2 = System.currentTimeMillis();
				map.put("cf", cf);
				map.put("dd", dd);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				String buyer = page.getElementById("buyer-licheng").asText();
				String avail = page.getElementById("avail-licheng").asText();//可消费里程
				String overdraft = page.getElementById("overdraft-licheng").asText();//可透支里程
				map.put("buyer", buyer);
				map.put("avail", avail);
				map.put("overdraft", overdraft);
				
				DomNodeList<HtmlElement> trs = tbl.getElementsByTagName("tr");
				for (int i = 1; i < trs.size(); i++) {
					HtmlElement tr = trs.get(i);
					String trStyle = tr.getAttribute("style");
					if(!trStyle.contains("none")) {
						LcTableInfo lcTableInfo = new LcTableInfo();
						DomNodeList<HtmlElement> tds = tr.getElementsByTagName("td");
						String cangWei = tds.get(0).asText();
						String cuXiaoLiCheng = tds.get(1).asText();
						String changGuiLiCheng = tds.get(2).getElementsByTagName("label").get(0).asText();
						lcTableInfo.setCangWei(cangWei);
						lcTableInfo.setCuXiaoLiCheng(cuXiaoLiCheng);
						lcTableInfo.setChangGuiLiCheng(changGuiLiCheng);
						lcTableInfos.add(lcTableInfo);
					}
				}
				map.put("lcTableInfos", lcTableInfos);
				
				HtmlDivision qc = page.getFirstByXPath("//div[@class='flightTcity']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='flightTTime']");
				HtmlDivision cityName = page.getFirstByXPath("//div[@class='flightTcityname']");
				log.info("qc==>"+qc);
				log.info("rq==>"+rq);
				log.info("cityName==>"+cityName);
				map.put("qc", qc.asText());
				map.put("rq", rq.asText());
				map.put("cityName", cityName.asText());
				
				HtmlDivision lk = page.getFirstByXPath("//div[@class='flightTdata']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span.spaceO");
				String adult = lkelments.get(0).text();
				map.put("adult", adult);

				HtmlUnorderedList ul = page.getFirstByXPath("//ul[@class='sp-trip-body']");
				Document document = Jsoup.parse(ul.asXml());
				Elements lis = document.select("li.showf");
				for (int i = 0; i < lis.size(); i++) {
					LcExchangeFlight f = new LcExchangeFlight();
					Element li = lis.get(i);
					if (li != null) {
						Element doc = li;
						// 起飞时间
						f.qf_time = doc.select("div.sp-trip-time").get(0).text().trim();
						// 起飞城市
						f.qf_city = doc.select("div.sp-trip-city").get(0).text().trim();
						// 到达时间
						f.dd_time = doc.select("div.sp-trip-time").get(1).text().trim();
						// 到达城市
						f.dd_city = doc.select("div.sp-trip-city").get(1).text().trim();
						// 航班号
						f.hbh = doc.select("div.sp-trip-stops").get(0).text().trim();
						// 飞机型号
						f.jx = doc.select("div.sp-trip-duration").get(0).text().trim();
						//剩余座位数
						f.seat = doc.select("span.showf").get(0).text().trim(); 
						//详情href
						f.details_id = doc.select("div.sp-trip-intre a").attr("aria-controls");
						//单选框data-href
						f.data_href = doc.select(".sp-cabin-cell1").attr("data-href");
					}
					lcExchangeFlights.add(f);
				}
				
				HtmlDivision qc2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTcity").get(1);
				HtmlDivision rq2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTTime").get(1);
				HtmlDivision cityName2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTcityname").get(1);
				log.info("qc2==>"+qc2);
				log.info("rq2==>"+rq2);
				log.info("cityName2==>"+cityName2);
				map.put("qc2", qc2.asText());
				map.put("rq2", rq2.asText());
				map.put("cityName2", cityName2.asText());

				HtmlDivision lk2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTdata").get(1);
				Document lk2doc = Jsoup.parse(lk2.asXml());
				Elements lk2elments = lk2doc.select("span.spaceO");
				String adult2 = lk2elments.get(0).text();
				map.put("adult2", adult2);
				
				
				HtmlUnorderedList ul2 = (HtmlUnorderedList) uls.get(1);
				Document document2 = Jsoup.parse(ul2.asXml());
				Elements li2s = document2.select("li.choose");
				for (int i = 0; i < li2s.size(); i++) {
					LcExchangeFlight2 f2 = new LcExchangeFlight2();
					Element li = li2s.get(i);
					if (li != null) {
						Element doc = li;
						// 起飞时间
						f2.qf_time = doc.select("div.sp-trip-time").get(0).text().trim();
						// 起飞城市
						f2.qf_city = doc.select("div.sp-trip-city").get(0).text().trim();
						// 到达时间
						f2.dd_time = doc.select("div.sp-trip-time").get(1).text().trim();
						// 到达城市
						f2.dd_city = doc.select("div.sp-trip-city").get(1).text().trim();
						// 航班号
						f2.hbh = doc.select("div.sp-trip-stops").get(0).text().trim();
						// 飞机型号
						f2.jx = doc.select("div.sp-trip-duration").get(0).text().trim();
						//剩余座位数
						f2.seat = doc.select("span.choose").get(0).text().trim(); 
						//详情href
						f2.details_id = doc.select("div.sp-trip-intre a").attr("aria-controls");
						//单选框data-href
						f2.data_href = doc.select(".sp-cabin-cell1").attr("data-href");
					}
					lcExchangeFlights2.add(f2);
				}
				map.put("lcExchangeFlights", lcExchangeFlights);
				map.put("lcExchangeFlights2", lcExchangeFlights2);
				
				String flightMileageCount = page.getElementById("flightMileageCount").asText();
				String flightMileageCondi = page.getElementById("flightMileageCondi").asText();
				map.put("flightMileageCount", flightMileageCount);
				map.put("flightMileageCondi", flightMileageCondi);
				
				map.put("t1", t1);
				map.put("t2", t2);
				scl.URLlcExchangeList = null;
				scl.URLflightWF = null;
				
				break;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("里程兑换页面加载中.......");
			}
		}
		for (int j = 0; j <= timeoutmax; j++) {
			HtmlDivision rls = page.getFirstByXPath("//div[@class='flightweek clearfix']");
			HtmlDivision rl2s = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightweek clearfix").get(1);
			List<Kalendar> kalendars = new ArrayList<Kalendar>();
			List<Kalendar2> kalendars2 = new ArrayList<Kalendar2>();
			if (rls != null && rl2s != null) {
				Document document = Jsoup.parse(rls.asXml());
				Elements elements = document.select("ul li");
				for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
					Element li = (Element) iterator.next();
					Kalendar k = new Kalendar();
					k.id = li.attr("data-date").trim();
//					log.info("cls:" + k.id);
					String cls = li.attr("class");
					if (cls != null && cls.trim().equals("") != true) {
						k.current = cls.trim();
					}
					k.week = li.select("a.weekBtn").get(0).ownText();
					k.date = li.select("span.spaceO").get(0).ownText();
					k.price = li.select("div.weekprice").get(0).ownText();
//					log.info(k);
					kalendars.add(k);
				}
				
				Document document2 = Jsoup.parse(rl2s.asXml());
				Elements elements2 = document2.select("ul li");
				for (Iterator<Element> iterator = elements2.iterator(); iterator.hasNext();) {
					Element li = (Element) iterator.next();
					Kalendar2 k2 = new Kalendar2();
					k2.id = li.attr("data-date").trim();
//					log.info("cls:" + k.id);
					String cls = li.attr("class");
					if (cls != null && cls.trim().equals("") != true) {
						k2.current = cls.trim();
					}
					k2.week = li.select("a.weekBtn").get(0).ownText();
					k2.date = li.select("span.spaceO").get(0).ownText();
					k2.price = li.select("div.weekprice").get(0).ownText();
//					log.info(k);
					kalendars2.add(k2);
				}
				map.put("kalendars", kalendars);
				map.put("kalendars2", kalendars2);
				break;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
		return map;
	}

	/**
	 * 里程兑换往返日历2
	 */
	@Override
	public Map<String, Object> lcExchangeListEx2(String id, String cf, String dd, String year, String month, String day,
			String year2, String month2, String day2) {
		Map<String, Object> map = new HashMap<String, Object>();
		List<LcExchangeFlight> lcExchangeFlights = new ArrayList<LcExchangeFlight>();
		List<LcExchangeFlight2> lcExchangeFlights2 = new ArrayList<LcExchangeFlight2>();
		List<LcTableInfo> lcTableInfos = new ArrayList<LcTableInfo>();
		long t1 = System.currentTimeMillis();
		HtmlPage page = lcExchangeListPage.getHtmlPage();
		HtmlDivision flightweekDiv2 =  (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightweek clearfix").get(1);
		DomNodeList<HtmlElement> flightweek2lis = flightweekDiv2.getElementsByTagName("li");
		HtmlElement he = null;
		for (int i = 0; i < flightweek2lis.size(); i++) {
			String li_dataName = flightweek2lis.get(i).getAttribute("data-date");
			if(id.equals(li_dataName)) {
				he = flightweek2lis.get(i);
				break;
			}
		}
		clickHandler(he);
		for (int j = 0; j <= timeoutmax; j++) {
			HtmlDivision confirmDiv = page.getFirstByXPath("//div[@class='confirm2-licheng']");
			if(confirmDiv !=null){
				long t2 = System.currentTimeMillis();
				map.put("errorAlert", "当天无南航航班或座位已售罄！");
				map.put("cf", cf);
				map.put("dd", dd);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				map.put("t1", t1);
				map.put("t2", t2);
				return map;
			}
			HtmlDivision alert_error = page.getFirstByXPath("//div[@class='alert-info alert-error']");
			HtmlDivision alert_error1 = page.getFirstByXPath("//div[@class='alertinfo-error']");
			
			if (alert_error != null || alert_error1 != null) {
				long t2 = System.currentTimeMillis();
				map.put("cf", cf);
				map.put("dd", dd);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				HtmlDivision qc = page.getFirstByXPath("//div[@class='flightTcity']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='flightTTime']");
				
				map.put("qc", qc.asText());// 全程
				map.put("rq", rq.asText());// 日期

				HtmlDivision lk = page.getFirstByXPath("//div[@class='flightTdata']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span.spaceO");
				String adult = lkelments.get(0).text();
				map.put("adult", adult);
				if(alert_error != null){
					map.put("noflight", alert_error.asText());
				}
				if(alert_error1 != null){
					map.put("noflight1", alert_error1.asText());
				}
				
				map.put("t1", t1);
				map.put("t2", t2);
				return map;
			}
		
			
			List<HtmlElement> uls = page.getBody().getElementsByAttribute("ul", "class", "sp-trip-body");
			HtmlDivision tbl = page.getFirstByXPath("//div[@class='licheng-tbl clearfix']");
			if (uls.size() > 1 && tbl != null) {
				long t2 = System.currentTimeMillis();
				map.put("cf", cf);
				map.put("dd", dd);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				String buyer = page.getElementById("buyer-licheng").asText();
				String avail = page.getElementById("avail-licheng").asText();//可消费里程
				String overdraft = page.getElementById("overdraft-licheng").asText();//可透支里程
				map.put("buyer", buyer);
				map.put("avail", avail);
				map.put("overdraft", overdraft);
				
				DomNodeList<HtmlElement> trs = tbl.getElementsByTagName("tr");
				for (int i = 1; i < trs.size(); i++) {
					HtmlElement tr = trs.get(i);
					String trStyle = tr.getAttribute("style");
					if(!trStyle.contains("none")) {
						LcTableInfo lcTableInfo = new LcTableInfo();
						DomNodeList<HtmlElement> tds = tr.getElementsByTagName("td");
						String cangWei = tds.get(0).asText();
						String cuXiaoLiCheng = tds.get(1).asText();
						String changGuiLiCheng = tds.get(2).getElementsByTagName("label").get(0).asText();
						lcTableInfo.setCangWei(cangWei);
						lcTableInfo.setCuXiaoLiCheng(cuXiaoLiCheng);
						lcTableInfo.setChangGuiLiCheng(changGuiLiCheng);
						lcTableInfos.add(lcTableInfo);
					}
				}
				map.put("lcTableInfos", lcTableInfos);
				
				HtmlDivision qc = page.getFirstByXPath("//div[@class='flightTcity']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='flightTTime']");
				HtmlDivision cityName = page.getFirstByXPath("//div[@class='flightTcityname']");
				log.info("qc==>"+qc);
				log.info("rq==>"+rq);
				log.info("cityName==>"+cityName);
				map.put("qc", qc.asText());
				map.put("rq", rq.asText());
				map.put("cityName", cityName.asText());
				
				HtmlDivision lk = page.getFirstByXPath("//div[@class='flightTdata']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span.spaceO");
				String adult = lkelments.get(0).text();
				map.put("adult", adult);

				HtmlUnorderedList ul = page.getFirstByXPath("//ul[@class='sp-trip-body']");
				Document document = Jsoup.parse(ul.asXml());
				Elements lis = document.select("li.showf");
				for (int i = 0; i < lis.size(); i++) {
					LcExchangeFlight f = new LcExchangeFlight();
					Element li = lis.get(i);
					if (li != null) {
						Element doc = li;
						// 起飞时间
						f.qf_time = doc.select("div.sp-trip-time").get(0).text().trim();
						// 起飞城市
						f.qf_city = doc.select("div.sp-trip-city").get(0).text().trim();
						// 到达时间
						f.dd_time = doc.select("div.sp-trip-time").get(1).text().trim();
						// 到达城市
						f.dd_city = doc.select("div.sp-trip-city").get(1).text().trim();
						// 航班号
						f.hbh = doc.select("div.sp-trip-stops").get(0).text().trim();
						// 飞机型号
						f.jx = doc.select("div.sp-trip-duration").get(0).text().trim();
						//剩余座位数
						f.seat = doc.select("span.showf").get(0).text().trim(); 
						//详情href
						f.details_id = doc.select("div.sp-trip-intre a").attr("aria-controls");
						//单选框data-href
						f.data_href = doc.select(".sp-cabin-cell1").attr("data-href");
					}
					lcExchangeFlights.add(f);
				}
				
				HtmlDivision qc2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTcity").get(1);
				HtmlDivision rq2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTTime").get(1);
				HtmlDivision cityName2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTcityname").get(1);
				log.info("qc2==>"+qc2);
				log.info("rq2==>"+rq2);
				log.info("cityName2==>"+cityName2);
				map.put("qc2", qc2.asText());
				map.put("rq2", rq2.asText());
				map.put("cityName2", cityName2.asText());

				HtmlDivision lk2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTdata").get(1);
				Document lk2doc = Jsoup.parse(lk2.asXml());
				Elements lk2elments = lk2doc.select("span.spaceO");
				String adult2 = lk2elments.get(0).text();
				map.put("adult2", adult2);
				
				
				HtmlUnorderedList ul2 = (HtmlUnorderedList) uls.get(1);
				Document document2 = Jsoup.parse(ul2.asXml());
				Elements li2s = document2.select("li.choose");
				for (int i = 0; i < li2s.size(); i++) {
					LcExchangeFlight2 f2 = new LcExchangeFlight2();
					Element li = li2s.get(i);
					if (li != null) {
						Element doc = li;
						// 起飞时间
						f2.qf_time = doc.select("div.sp-trip-time").get(0).text().trim();
						// 起飞城市
						f2.qf_city = doc.select("div.sp-trip-city").get(0).text().trim();
						// 到达时间
						f2.dd_time = doc.select("div.sp-trip-time").get(1).text().trim();
						// 到达城市
						f2.dd_city = doc.select("div.sp-trip-city").get(1).text().trim();
						// 航班号
						f2.hbh = doc.select("div.sp-trip-stops").get(0).text().trim();
						// 飞机型号
						f2.jx = doc.select("div.sp-trip-duration").get(0).text().trim();
						//剩余座位数
						f2.seat = doc.select("span.choose").get(0).text().trim(); 
						//详情href
						f2.details_id = doc.select("div.sp-trip-intre a").attr("aria-controls");
						//单选框data-href
						f2.data_href = doc.select(".sp-cabin-cell1").attr("data-href");
					}
					lcExchangeFlights2.add(f2);
				}
				map.put("lcExchangeFlights", lcExchangeFlights);
				map.put("lcExchangeFlights2", lcExchangeFlights2);
				
				String flightMileageCount = page.getElementById("flightMileageCount").asText();
				String flightMileageCondi = page.getElementById("flightMileageCondi").asText();
				map.put("flightMileageCount", flightMileageCount);
				map.put("flightMileageCondi", flightMileageCondi);
				
				map.put("t1", t1);
				map.put("t2", t2);
				scl.URLlcExchangeList = null;
				scl.URLflightWF = null;
				
				break;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("里程兑换页面加载中.......");
			}
		}
		for (int j = 0; j <= timeoutmax; j++) {
			HtmlDivision rls = page.getFirstByXPath("//div[@class='flightweek clearfix']");
			HtmlDivision rl2s = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightweek clearfix").get(1);
			List<Kalendar> kalendars = new ArrayList<Kalendar>();
			List<Kalendar2> kalendars2 = new ArrayList<Kalendar2>();
			if (rls != null && rl2s != null) {
				Document document = Jsoup.parse(rls.asXml());
				Elements elements = document.select("ul li");
				for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
					Element li = (Element) iterator.next();
					Kalendar k = new Kalendar();
					k.id = li.attr("data-date").trim();
//					log.info("cls:" + k.id);
					String cls = li.attr("class");
					if (cls != null && cls.trim().equals("") != true) {
						k.current = cls.trim();
					}
					k.week = li.select("a.weekBtn").get(0).ownText();
					k.date = li.select("span.spaceO").get(0).ownText();
					k.price = li.select("div.weekprice").get(0).ownText();
//					log.info(k);
					kalendars.add(k);
				}
				
				Document document2 = Jsoup.parse(rl2s.asXml());
				Elements elements2 = document2.select("ul li");
				for (Iterator<Element> iterator = elements2.iterator(); iterator.hasNext();) {
					Element li = (Element) iterator.next();
					Kalendar2 k2 = new Kalendar2();
					k2.id = li.attr("data-date").trim();
//					log.info("cls:" + k.id);
					String cls = li.attr("class");
					if (cls != null && cls.trim().equals("") != true && cls.trim().equals(" disweek") != true) {
						k2.current = cls.trim();
					}else if(cls != null && cls.trim().equals("") != true && cls.trim().equals(" disweek") == true) {
						k2.current = "disweek";
					}
					k2.week = li.select("a.weekBtn").get(0).ownText();
					k2.date = li.select("span.spaceO").get(0).ownText();
					k2.price = li.select("div.weekprice").get(0).ownText();
//					log.info(k);
					kalendars2.add(k2);
				}
				map.put("kalendars", kalendars);
				map.put("kalendars2", kalendars2);
				break;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
		return map;
	}

	
	
	
	/**
	 * 刷新里程兑换航班列表（单程）
	 * @param liChengIdBeChecked
	 * @return
	 */
	@Override
	public Map<String, Object> loadLcFilightInfo(String liChengIdBeChecked) {
		Map<String, Object> map = new HashMap<String ,Object>();
		List<LcExchangeFlight> lcExchangeFlights = new ArrayList<LcExchangeFlight>();
		HtmlPage page = lcExchangeListPage.getHtmlPage();
		HtmlDivision lichengTbl = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "licheng-tbl clearfix").get(0);
		DomNodeList<HtmlElement> labels = lichengTbl.getElementsByTagName("label");
		log.info("labels.size()===>"+labels.size());
		for (int i = 0; i < labels.size(); i++) {
			HtmlElement label = labels.get(i);
			String liChengCount = label.asText();
			if(liChengIdBeChecked.equals(liChengCount)) {
				clickHandler(label);
				HtmlUnorderedList ul = page.getFirstByXPath("//ul[@class='sp-trip-body']");
				Document document = Jsoup.parse(ul.asXml());
				Elements lis = document.select("li.showf");
				for (int j = 0; j < lis.size(); j++) {
					LcExchangeFlight f = new LcExchangeFlight();
					Element li = lis.get(j);
					if (li != null) {
						Element doc = li;
						// 起飞时间
						f.qf_time = doc.select("div.sp-trip-time").get(0).text().trim();
						// 起飞城市
						f.qf_city = doc.select("div.sp-trip-city").get(0).text().trim();
						// 到达时间
						f.dd_time = doc.select("div.sp-trip-time").get(1).text().trim();
						// 到达城市
						f.dd_city = doc.select("div.sp-trip-city").get(1).text().trim();
						// 航班号
						f.hbh = doc.select("div.sp-trip-stops").get(0).text().trim();
						// 飞机型号
						f.jx = doc.select("div.sp-trip-duration").get(0).text().trim();
						//剩余座位数
						f.seat = doc.select("span.showf").get(0).text().trim(); 
						//详情href
						f.details_id = doc.select("div.sp-trip-intre a").attr("aria-controls");
						//单选框data-href
						f.data_href = doc.select(".sp-cabin-cell1").attr("data-href");
					}
					lcExchangeFlights.add(f);
				}
				map.put("lcExchangeFlights", lcExchangeFlights);
				String flightMileageCount = page.getElementById("flightMileageCount").asText();
				String flightMileageCondi = page.getElementById("flightMileageCondi").asText();
				map.put("flightMileageCount", flightMileageCount);
				map.put("flightMileageCondi", flightMileageCondi);
				break;
			}
		}
		
		return map;
	}

	/**
	 *  刷新里程兑换航班列表（往返）
	 */
	@Override
	public Map<String, Object> loadLcFlightInfoWF(String liChengIdBeChecked) {
		Map<String, Object> map = new HashMap<String ,Object>();
		List<LcExchangeFlight> lcExchangeFlights = new ArrayList<LcExchangeFlight>();
		List<LcExchangeFlight2> lcExchangeFlights2 = new ArrayList<LcExchangeFlight2>();
		HtmlPage page = lcExchangeListPage.getHtmlPage();
		HtmlDivision lichengTbl = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "licheng-tbl clearfix").get(0);
		DomNodeList<HtmlElement> labels = lichengTbl.getElementsByTagName("label");
		log.info("labels.size()===>"+labels.size());
		for (int i = 0; i < labels.size(); i++) {
			HtmlElement label = labels.get(i);
			String liChengCount = label.asText();
			if(liChengIdBeChecked.equals(liChengCount)) {
				clickHandler(label);
				
				List<HtmlElement> uls = page.getBody().getElementsByAttribute("ul", "class", "sp-trip-body");
				HtmlDivision qc = page.getFirstByXPath("//div[@class='flightTcity']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='flightTTime']");
				HtmlDivision cityName = page.getFirstByXPath("//div[@class='flightTcityname']");
				map.put("qc", qc.asText());
				map.put("rq", rq.asText());
				map.put("cityName", cityName.asText());
				
				HtmlDivision lk = page.getFirstByXPath("//div[@class='flightTdata']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span.spaceO");
				String adult = lkelments.get(0).text();
				map.put("adult", adult);

				HtmlUnorderedList ul = page.getFirstByXPath("//ul[@class='sp-trip-body']");
				Document document = Jsoup.parse(ul.asXml());
				Elements lis = document.select("li.showf");
				for (int j = 0; j < lis.size(); j++) {
					LcExchangeFlight f = new LcExchangeFlight();
					Element li = lis.get(j);
					if (li != null) {
						Element doc = li;
						// 起飞时间
						f.qf_time = doc.select("div.sp-trip-time").get(0).text().trim();
						// 起飞城市
						f.qf_city = doc.select("div.sp-trip-city").get(0).text().trim();
						// 到达时间
						f.dd_time = doc.select("div.sp-trip-time").get(1).text().trim();
						// 到达城市
						f.dd_city = doc.select("div.sp-trip-city").get(1).text().trim();
						// 航班号
						f.hbh = doc.select("div.sp-trip-stops").get(0).text().trim();
						// 飞机型号
						f.jx = doc.select("div.sp-trip-duration").get(0).text().trim();
						//剩余座位数
						f.seat = doc.select("span.showf").get(0).text().trim(); 
						//详情href
						f.details_id = doc.select("div.sp-trip-intre a").attr("aria-controls");
						//单选框data-href
						f.data_href = doc.select(".sp-cabin-cell1").attr("data-href");
					}
					lcExchangeFlights.add(f);
				}
				
				HtmlDivision qc2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTcity").get(1);
				HtmlDivision rq2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTTime").get(1);
				HtmlDivision cityName2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTcityname").get(1);
				map.put("qc2", qc2.asText());
				map.put("rq2", rq2.asText());
				map.put("cityName2", cityName2.asText());

				HtmlDivision lk2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightTdata").get(1);
				Document lk2doc = Jsoup.parse(lk2.asXml());
				Elements lk2elments = lk2doc.select("span.spaceO");
				String adult2 = lk2elments.get(0).text();
				map.put("adult2", adult2);
				
				
				HtmlUnorderedList ul2 = (HtmlUnorderedList) uls.get(1);
				Document document2 = Jsoup.parse(ul2.asXml());
				Elements li2s = document2.select("li.choose");
				for (int j = 0; j < li2s.size(); j++) {
					LcExchangeFlight2 f2 = new LcExchangeFlight2();
					Element li = li2s.get(j);
					if (li != null) {
						Element doc = li;
						// 起飞时间
						f2.qf_time = doc.select("div.sp-trip-time").get(0).text().trim();
						// 起飞城市
						f2.qf_city = doc.select("div.sp-trip-city").get(0).text().trim();
						// 到达时间
						f2.dd_time = doc.select("div.sp-trip-time").get(1).text().trim();
						// 到达城市
						f2.dd_city = doc.select("div.sp-trip-city").get(1).text().trim();
						// 航班号
						f2.hbh = doc.select("div.sp-trip-stops").get(0).text().trim();
						// 飞机型号
						f2.jx = doc.select("div.sp-trip-duration").get(0).text().trim();
						//剩余座位数
						f2.seat = doc.select("span.choose").get(0).text().trim(); 
						//详情href
						f2.details_id = doc.select("div.sp-trip-intre a").attr("aria-controls");
						//单选框data-href
						f2.data_href = doc.select(".sp-cabin-cell1").attr("data-href");
					}
					lcExchangeFlights2.add(f2);
				}
				map.put("lcExchangeFlights", lcExchangeFlights);
				map.put("lcExchangeFlights2", lcExchangeFlights2);
				
				String flightMileageCount = page.getElementById("flightMileageCount").asText();
				String flightMileageCondi = page.getElementById("flightMileageCondi").asText();
				map.put("flightMileageCount", flightMileageCount);
				map.put("flightMileageCondi", flightMileageCondi);
				

				HtmlDivision rls = page.getFirstByXPath("//div[@class='flightweek clearfix']");
				HtmlDivision rl2s = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "flightweek clearfix").get(1);
				List<Kalendar> kalendars = new ArrayList<Kalendar>();
				List<Kalendar2> kalendars2 = new ArrayList<Kalendar2>();
				Document doc = Jsoup.parse(rls.asXml());
				Elements elements = doc.select("ul li");
				for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
					Element li = (Element) iterator.next();
					Kalendar k = new Kalendar();
					k.id = li.attr("data-date").trim();
//					log.info("cls:" + k.id);
					String cls = li.attr("class");
					if (cls != null && cls.trim().equals("") != true) {
						k.current = cls.trim();
					}
					k.week = li.select("a.weekBtn").get(0).ownText();
					k.date = li.select("span.spaceO").get(0).ownText();
					k.price = li.select("div.weekprice").get(0).ownText();
//					log.info(k);
					kalendars.add(k);
				}
				
				Document doc2 = Jsoup.parse(rl2s.asXml());
				Elements elements2 = doc2.select("ul li");
				for (Iterator<Element> iterator = elements2.iterator(); iterator.hasNext();) {
					Element li = (Element) iterator.next();
					Kalendar2 k2 = new Kalendar2();
					k2.id = li.attr("data-date").trim();
//					log.info("cls:" + k.id);
					String cls = li.attr("class");
					if (cls != null && cls.trim().equals("") != true && cls.trim().equals(" disweek") != true) {
						k2.current = cls.trim();
					}else if(cls != null && cls.trim().equals("") != true && cls.trim().equals(" disweek") == true) {
						k2.current = "disweek";
					}
					k2.week = li.select("a.weekBtn").get(0).ownText();
					k2.date = li.select("span.spaceO").get(0).ownText();
					k2.price = li.select("div.weekprice").get(0).ownText();
//					log.info(k);
					kalendars2.add(k2);
				}
				map.put("kalendars", kalendars);
				map.put("kalendars2", kalendars2);
				break;
			}
		}
		return map;
	}

	
	
	/**
	 * 里程兑换页面点击下一步（单程）
	 */
	@Override
	public Map<String, Object> lcExchangeNext(String data_href) {
		scl.URLPassengerInformation = null;
		Map<String, Object> map = new HashMap<String ,Object>();
		HtmlPage page = lcExchangeListPage.getHtmlPage();
		List<HtmlElement> radioList = page.getBody().getElementsByAttribute("div", "role", "radio");
		for (int i = 0; i < radioList.size(); i++) {
			HtmlElement radioDiv = radioList.get(i);
			String radio_data_href = radioDiv.getAttribute("data-href");
			log.info("data_href===>"+data_href+",radio_data_href===>"+radio_data_href);
			if(data_href.equals(radio_data_href)) {
				clickHandler(radioDiv);
				HtmlButton submitForm = (HtmlButton) page.getElementById("submitForm");
				clickHandler(submitForm);
				for (int j = 0; j < timeoutmax; j++) {
					HtmlDivision alert_msg_box = (HtmlDivision) page.getElementById("alert_msg_box");
					if(alert_msg_box != null) {
						String style = alert_msg_box.getAttribute("style");
						if(!style.contains("none")) {
							HtmlDivision confirm_window = (HtmlDivision) alert_msg_box.getElementsByAttribute("div", "class", "confirm-window").get(0);
							String errorinfo = confirm_window.getElementsByTagName("p").get(0).asText();
							map.put("errorinfo", errorinfo);
							map.put("notice", "false");
							return map;
						}
					}
					if (scl.URLPassengerInformation != null) {
						log.info("旅客信息页面url=====>" + scl.URLPassengerInformation);
						map.put("notice", "true");
						return map;
					}
					synchronized (page) {
						try {
							page.wait(500);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						log.info("等待返回url.....");
					}
					
				}
				
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				log.info("点击“下一步”等待反馈......");
			}
		}
		return map;
	}
	
	
	/**
	 * 里程兑换页面点击下一步（往返）
	 */
	@Override
	public Map<String, Object> lcExchangeNext2(String data_href1, String data_href2) {
		scl.URLPassengerInformation = null;
		Map<String, Object> map = new HashMap<String ,Object>();
		HtmlPage page = lcExchangeListPage.getHtmlPage();
		HtmlDivision box1 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "sp-trip-box").get(0);
		List<HtmlElement> radioList1 = box1.getElementsByAttribute("div", "role", "radio");
		for (int i = 0; i < radioList1.size(); i++) {
			HtmlElement radioDiv1 = radioList1.get(i);
			String radio_data_href1 = radioDiv1.getAttribute("data-href");
			log.info("data_href1===>"+data_href1+",radio_data_href1===>"+radio_data_href1);
			if(data_href1.equals(radio_data_href1)) {
				clickHandler(radioDiv1);
				break;
			}
		}
		
		HtmlDivision box2 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "sp-trip-box").get(1);
		List<HtmlElement> radioList2 = box2.getElementsByAttribute("div", "role", "radio");
		for (int i = 0; i < radioList2.size(); i++) {
			HtmlElement radioDiv2 = radioList2.get(i);
			String radio_data_href2 = radioDiv2.getAttribute("data-href");
			log.info("data_href2===>"+data_href2+",radio_data_href2===>"+radio_data_href2);
			if(data_href2.equals(radio_data_href2)) {
				clickHandler(radioDiv2);
				break;
			}
		}
		
		HtmlButton submitForm = (HtmlButton) page.getElementById("submitForm");
		clickHandler(submitForm);
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision alert_msg_box = (HtmlDivision) page.getElementById("alert_msg_box");
			if(alert_msg_box != null) {
				String style = alert_msg_box.getAttribute("style");
				if(!style.contains("none")) {
					HtmlDivision confirm_window = (HtmlDivision) alert_msg_box.getElementsByAttribute("div", "class", "confirm-window").get(0);
					String errorinfo = confirm_window.getElementsByTagName("p").get(0).asText();
					map.put("errorinfo", errorinfo);
					map.put("notice", "false");
					return map;
				}
			}
			if (scl.URLPassengerInformation != null) {
				log.info("旅客信息页面url=====>" + scl.URLPassengerInformation);
				map.put("notice", "true");
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("等待返回url.....");
			}
			
		}
		map.put("errorinfo", "加载超时！");
		map.put("notice", "false");
		return map;
	}

	/**
	 * 加载里程兑换乘客信息页面
	 */
	@Override
	public Map<String, Object> lcPassenger() {
		Map<String, Object> map = new HashMap<String, Object>();
		log.info("加载旅客信息页面url:" + scl.URLPassengerInformation);
		if (scl.URLPassengerInformation != null) {
			lcPassengerInformationPage = webClient.getCsairHtmlPage(scl.URLPassengerInformation,"URLPassengerInformation", false);
			HtmlPage page = lcPassengerInformationPage.getHtmlPage();
			for (int i = 0; i < timeoutmax; i++) {
				
				HtmlAnchor costA = (HtmlAnchor) page.getElementById("cost");
				HtmlUnorderedList sNameList = (HtmlUnorderedList) page.getElementById("sName-list");
				if(costA != null && sNameList != null) {
					if (!costA.asText().trim().equals("")) {
						
						HtmlParagraph flightRangeP = (HtmlParagraph) page.getBody().getElementsByAttribute("p", "class", "flight-range").get(0);
						String hangCheng = flightRangeP.asText();
						map.put("hangCheng", hangCheng);
						
						String baoXianFei = costA.asText();
						map.put("baoXianFei", baoXianFei);
						
						HtmlDivision taxDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "tax").get(0);
						HtmlSpan dingDanShuiFeiSpan = (HtmlSpan) taxDiv.getElementsByTagName("span").get(0);
						String dingDanShuiFei = dingDanShuiFeiSpan.asText();
						map.put("dingDanShuiFei", dingDanShuiFei);
						
						HtmlDivision checkboxDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "role", "checkbox").get(0);
						String baoxianCheck = checkboxDiv.getAttribute("aria-checked");
						map.put("baoxianCheck", baoxianCheck);
						
						HtmlTable flightInfoTable0 = (HtmlTable) page.getBody().getElementsByAttribute("table", "class", "flight-info-table").get(0);
						DomNodeList<HtmlElement> flightInfoTable0Trs = flightInfoTable0.getElementsByTagName("tr");
						List<LcFlightInfo> lcFlightInfoList = new ArrayList<LcFlightInfo>();
						for (int i1 = 0; i1 < (flightInfoTable0Trs.size()-1)/2; i1++) {
							LcFlightInfo lcFlightInfo = new LcFlightInfo();
							HtmlElement flightInfoTable0Tr = flightInfoTable0Trs.get(2*i1+1);
							DomNodeList<HtmlElement> flightInfoTable0TrTds = flightInfoTable0Tr.getElementsByTagName("td");
							lcFlightInfo.setHangBanHao(flightInfoTable0TrTds.get(0).asText());
							lcFlightInfo.setCangWei(flightInfoTable0TrTds.get(1).asText());
							lcFlightInfo.setJiXing(flightInfoTable0TrTds.get(2).asText());
							lcFlightInfo.setRiQi(flightInfoTable0TrTds.get(3).asText());
							lcFlightInfo.setChuFa(flightInfoTable0TrTds.get(4).asText());
							lcFlightInfo.setDiDa(flightInfoTable0TrTds.get(5).asText());
							lcFlightInfoList.add(lcFlightInfo);
						}
						map.put("lcFlightInfoList", lcFlightInfoList);
						
						HtmlTable flightInfoTable1 = (HtmlTable) page.getBody().getElementsByAttribute("table", "class", "flight-info-table").get(1);
						DomNodeList<HtmlElement> flightInfoTable1Trs = flightInfoTable1.getElementsByTagName("tr");
						List<LcPassengerInfo> lcPassengerInfoList = new ArrayList<LcPassengerInfo>();
						for (int i1 = 1; i1 < flightInfoTable1Trs.size(); i1++) {
							LcPassengerInfo lcPassengerInfo = new LcPassengerInfo();
							HtmlElement flightInfoTable1Tr = flightInfoTable1Trs.get(i1);
							DomNodeList<HtmlElement> flightInfoTable1TrTds = flightInfoTable1Tr.getElementsByTagName("td");
							lcPassengerInfo.setLeiXing(flightInfoTable1TrTds.get(0).asText());
							lcPassengerInfo.setLiChengShu(flightInfoTable1TrTds.get(1).asText());
							lcPassengerInfo.setPiaoJia(flightInfoTable1TrTds.get(2).asText());
							lcPassengerInfo.setJiChangShui(flightInfoTable1TrTds.get(3).asText());
							lcPassengerInfo.setRanYouFei(flightInfoTable1TrTds.get(4).asText());
							lcPassengerInfo.setRenShu(flightInfoTable1TrTds.get(5).asText());
							lcPassengerInfo.setZongJia(flightInfoTable1TrTds.get(6).asText());
							lcPassengerInfoList.add(lcPassengerInfo);
						}
						map.put("lcPassengerInfoList", lcPassengerInfoList);
						
						List<LcPassengerInfo2> lcPassengerInfo2List = new ArrayList<LcPassengerInfo2>();
						DomNodeList<HtmlElement> lis = sNameList.getElementsByTagName("li");
						for (int j = 0; j < timeoutmax; j++) {
							log.info("lis.size====>"+lis.size());
							if(lis.size() != 0) {
								for (int j1 = 0; j1 < lis.size(); j1++) {
									LcPassengerInfo2 lcPassengerInfo2 = new LcPassengerInfo2();
									HtmlElement li = lis.get(j1);
									String cnname = li.getAttribute("cnname");
									String enname = li.getAttribute("enname");
									log.info("cnname"+j1+"=====>"+cnname);
									log.info("enname"+j1+"=====>"+enname);
									lcPassengerInfo2.setCnname(cnname);
									lcPassengerInfo2.setEnname(enname);
									lcPassengerInfo2List.add(lcPassengerInfo2);
								}
								map.put("lcPassengerInfo2List", lcPassengerInfo2List);
								

								HtmlElement li1 = lis.get(0);
								String psgName = li1.getAttribute("cnname");
								log.info("psgName====>"+psgName);
								map.put("psgName", psgName);
								
								String psgIdNum = li1.getAttribute("ni");
								log.info("psgIdNum====>"+psgIdNum);
								map.put("psgIdNum", psgIdNum);
								
								HtmlInput psgMobileInput = (HtmlInput) page.getElementById("psg-mobile");
								String psgMobile = psgMobileInput.getAttribute("placeholder");
								log.info("psgMobile====>"+psgMobile);
								map.put("psgMobile", psgMobile);
								
								HtmlInput psgEmailInput = (HtmlInput) page.getElementById("psg-email");
								String psgEmail = psgEmailInput.getAttribute("placeholder");
								log.info("psgEmail====>"+psgEmail);
								map.put("psgEmail", psgEmail);
								break;
							}
							synchronized (page) {
								try {
									page.wait(1000);
									log.info("加载li........");
								} catch (InterruptedException e) {
									// TODO Auto-generated catch block
									e.printStackTrace();
								}
							}
						}
						
						scl.URLPassengerInformation = null;
						return map;
					}
				}
				
				synchronized (lcPassengerInformationPage) {
					try {
						lcPassengerInformationPage.wait(1000);
					} catch (InterruptedException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
					log.info("加载页面文件.....");
				}
				
				
			}
			
			passengerInformationPage.setLS(CS.TIMEOUT);
			log.info(passengerInformationPage.getLS());
		}
		map.put("errorinfo", "加载超时！");
		map.put("notice", "false");
		return map;
	}


	/**
	 * 里程兑换乘客信息页面点击保险
	 */
	@Override
	public Map<String, Object> baoxiancheckloadLCFilightInfo() {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = lcPassengerInformationPage.getHtmlPage();
		HtmlDivision checkboxDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "role", "checkbox").get(0);
		clickHandler(checkboxDiv);
		try {
			Thread.sleep(200);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		HtmlAnchor costA = (HtmlAnchor) page.getElementById("cost");
		String baoXianFei = costA.asText();
		map.put("baoXianFei", baoXianFei);
		
		String baoxianCheck = checkboxDiv.getAttribute("aria-checked");
		map.put("baoxianCheck", baoxianCheck);
		return map;
	}

	/**
	 * 旅客信息证件类型变更方法
	 */
	@Override
	public Map<String, Object> cardTypeChange(String cardTypeValue) {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = lcPassengerInformationPage.getHtmlPage();
		HtmlUnorderedList iTypeListUl = (HtmlUnorderedList) page.getElementById("iType-list");
		iTypeListUl.setAttribute("style", "display:block");
		DomNodeList<HtmlElement> lis = iTypeListUl.getElementsByTagName("li");
		for (int i = 0; i < lis.size(); i++) {
			HtmlElement li = lis.get(i);
			String liId = li.getAttribute("id");
			if(liId.equals(cardTypeValue)) {
				log.info("liId====>"+liId);
				clickHandler(li);
				String liAriaSelected = li.getAttribute("aria-selected");
				log.info("liAriaSelected====>"+liAriaSelected);
				String liMenber = li.getAttribute("menber");
				log.info("liMenber====>"+liMenber);
				map.put("menber", liMenber);
				return map;
			}
		}
		return map;
	}

	
/**
 * 可选旅客变更(里程兑换)
 */
	@Override
	public Map<String, Object> kxPassengerChange(String enname,String cardTypeValue) {
		scl.loadAlienee = null;
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = lcPassengerInformationPage.getHtmlPage();
		String str ="$('#sName-list').attr('style','display:block');";
		page.executeJavaScript(str);
		HtmlUnorderedList sNameListUl = (HtmlUnorderedList) page.getElementById("sName-list");
		String sNameListUlStyle = sNameListUl.getAttribute("style");
		log.info("sNameListUlStyle1====>"+sNameListUlStyle);
		DomNodeList<HtmlElement> lis = sNameListUl.getElementsByTagName("li");
		for (int i = 0; i < lis.size(); i++) {
			HtmlElement li = lis.get(i);
			String liEnname = li.getAttribute("enname");
			if(liEnname.equals(enname)) {
				clickHandler(li);
				log.info(li.asXml());
				String liType = li.getAttribute("type");
				log.info("liType====>"+liType);
				for (int j = 0; j < timeoutmax; j++) {
					String liAriaSelected = li.getAttribute("aria-selected");
					log.info("liAriaSelected====>"+liAriaSelected);
					if(liAriaSelected.equals("true")) {
						String liCnname = li.getAttribute("cnname");
						log.info("liCnname====>"+liCnname);
						String menber = "";
						String showCheckVcodeDivStyle = "";
						String mileageCheckMobile = "";
						String mileageCheckEmail = "";
						if("alienee".equals(liType)) {
							for (int k = 0; k < timeoutmax; k++) {
								HtmlDivision showCheckVcodeDiv = (HtmlDivision) page.getElementById("showCheckVcode");
								showCheckVcodeDivStyle = showCheckVcodeDiv.getAttribute("style");
								log.info("showCheckVcodeDivStyle====>"+showCheckVcodeDivStyle);
								if(scl.loadAlienee != null && showCheckVcodeDivStyle.contains("block")) {
									menber = li.getAttribute(cardTypeValue);
									log.info("menber====>"+menber);
									HtmlSpan mileageCheckMobileSpan = (HtmlSpan) page.getElementById("mileageCheckMobile");
									mileageCheckMobile = mileageCheckMobileSpan.asText();
									HtmlLabel emailDiv = (HtmlLabel) page.getElementById("emaildiv");
									String emailDivStyle = emailDiv.getAttribute("style");
									log.info("emailDivStyle====>"+emailDivStyle);
									if(emailDivStyle.contains("none")) {
										
									}else {
										HtmlSpan mileageCheckEmailSpan = (HtmlSpan) page.getElementById("mileageCheckEmail");
										mileageCheckEmail = mileageCheckEmailSpan.asText();
									}
									break;
								}
								synchronized (page) {
									try {
										page.wait(500);
										log.info("加载里程兑换受让人文件.......");
									} catch (InterruptedException e) {
										e.printStackTrace();
									}
								}
							}
							if(scl.loadAlienee == null || !showCheckVcodeDivStyle.contains("block")) {
								map.put("msg", "受让人校验框加载超时！");
								map.put("notice", "false");
								return map;
							}
							
						}else {
							menber = li.getAttribute(cardTypeValue);
							log.info("menber====>"+menber);
							HtmlDivision showCheckVcodeDiv = (HtmlDivision) page.getElementById("showCheckVcode");
							showCheckVcodeDivStyle = showCheckVcodeDiv.getAttribute("style");
							log.info("showCheckVcodeDivStyle====>"+showCheckVcodeDivStyle);
						}
						
						map.put("psgName", liCnname);
						map.put("menber", menber);
						map.put("showCheckVcodeDivStyle", showCheckVcodeDivStyle);
						map.put("mileageCheckMobile", mileageCheckMobile);
						map.put("mileageCheckEmail", mileageCheckEmail);
						return map;
					}
					synchronized (page) {
						try {
							page.wait(500);
							log.info("加载里程兑换受让人点击动作......");
						} catch (InterruptedException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
					}
				}
				
			}
		}
		return map;
	}

	/**
	 * 受让人点击发送验证码(里程兑换)
	 */
	@Override
	public Map<String, Object> lcAssigneeCtrlYzm(String checkVcodeId) {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = lcPassengerInformationPage.getHtmlPage();
		HtmlInput checkVcodeInput = (HtmlInput) page.getElementById(checkVcodeId);
		clickHandler(checkVcodeInput);
		HtmlAnchor checkVcodeButton = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "class", "btn_checkVcode").get(0);
		log.info(checkVcodeButton.asXml());
		clickHandler(checkVcodeButton);
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision jqmWindowDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "ppwindowalldiv jqmWindow").get(0);
			log.info(jqmWindowDiv.asXml());
			String jqmWindowDivStyle = jqmWindowDiv.getAttribute("style");
			log.info("jqmWindowDivStyle====>"+jqmWindowDivStyle);
			if(jqmWindowDivStyle.contains("block")) {
				HtmlDivision messageDiv = (HtmlDivision) page.getElementById("message");
				String sendMessage = messageDiv.asText();
				log.info("sendMessage====>"+sendMessage);
				HtmlAnchor btnsty1 = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "class", "btnsty1").get(0);
				clickHandler(btnsty1);
				map.put("msg", sendMessage);
				map.put("notice", "success");
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
					log.info("等待发送验证码.......");
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
		map.put("notice", "false");
		map.put("msg", "验证码发送失败！");
		return map;
	}

	/**
	 * 里程兑换受让人校验
	 */
	@Override
	public Map<String, Object> lcAssigneeCtrlCheck(String code) {
		alertMessage = null;
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = lcPassengerInformationPage.getHtmlPage();
		HtmlInput randInput = (HtmlInput) page.getElementById("rand");
		randInput.setValueAttribute(code);
		HtmlAnchor jyButton = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "class", "btn_checkVcode_check disablebtn").get(0);
		clickHandler(jyButton);
		for (int i = 0; i < timeoutmax; i++) {
			if(alertMessage != null) {
				map.put("msg", alertMessage);
				return map;
			}
			
			HtmlDivision errorInfoDiv = (HtmlDivision) page.getElementById("error-info");
			if(errorInfoDiv != null) {
				String errorInfoDivStyle = errorInfoDiv.getAttribute("style");
				if(errorInfoDivStyle.contains("block")) {
					HtmlUnorderedList errorListUl = (HtmlUnorderedList) page.getBody().getElementsByAttribute("ul", "class", "error-list").get(0);
					String str = "";
					DomNodeList<HtmlElement> lis = errorListUl.getElementsByTagName("li");
					for (int j = 0; j < lis.size(); j++) {
						str += lis.get(j).asText()+"       ";
					}
					map.put("msg", str);
					return map;
				}
			}
			synchronized (page) {
				try {
					page.wait(500);
					log.info("获取验证信息.......");
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
		map.put("msg", "验证超时，验证失败！");
		return map;
	}

	/**
	 * 提交旅客信息（里程兑换）
	 */
	@Override
	public CsairReturnValue lcPassengerInformation(String contact_name, String contact_moblie, String e_mail) {
		
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = lcPassengerInformationPage.getHtmlPage();
		HtmlInput contactNameInput = (HtmlInput) page.getElementById("contact-name");
		contactNameInput.setValueAttribute(contact_name);
//		HtmlInput contactMobileInput = (HtmlInput) page.getElementById("contact-mobile");
//		contactMobileInput.setValueAttribute(contact_moblie);
		StringBuilder contactMobile = new StringBuilder();
		contactMobile.append("$('#contact-mobile').data('value','").append(contact_moblie).append("');"); 
		page.executeJavaScript(contactMobile.toString());
//		HtmlInput contactEmailInput = (HtmlInput) page.getElementById("contact-email");
//		contactEmailInput.setValueAttribute(e_mail);
		StringBuilder contactEmail = new StringBuilder();
		contactEmail.append("$('#contact-email').data('value','").append(e_mail).append("');");  
        page.executeJavaScript(contactEmail.toString());
		HtmlAnchor protocolCheckboxInput = (HtmlAnchor) page.getElementById("protocol-checkbox");
		clickHandler(protocolCheckboxInput);
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e1) {
			e1.printStackTrace();
		}
		scl.change3 = null;
		HtmlButton submitFormButton = (HtmlButton) page.getElementById("submitForm");
		clickHandler(submitFormButton);
		for (int i = 0; i < timeoutmax; i++) {
			if(scl.change3 != null) {
				HtmlDivision errorInfoDiv = (HtmlDivision) page.getElementById("error-info");
				if(errorInfoDiv != null) {
					String errorInfoDivStyle = errorInfoDiv.getAttribute("style");
					if(errorInfoDivStyle.contains("block")) {
						returnValue.setState(CS.FAIL);
						HtmlUnorderedList errorListUl = (HtmlUnorderedList) page.getBody().getElementsByAttribute("ul", "class", "error-list").get(0);
						String str = "";
						DomNodeList<HtmlElement> lis = errorListUl.getElementsByTagName("li");
						for (int j = 0; j < lis.size(); j++) {
							str += lis.get(j).asText()+"       ";
						}
						returnValue.setMessage(str);
					return returnValue;
					}
				}
				
				for (int i1 = 0; i1 < 15; i1++) {
					log.info("进入循环！");
					if (scl.URLpay != null) {
						log.info("发现生成订单文件！");
						returnValue.setState(CS.SUCCESS);
						log.info("scl.URLpay==>"+scl.URLpay);
						scl.URLpay = null;
						log.info("清空URLpay,scl.URLpay==>"+scl.URLpay);
						return returnValue;
					}
					synchronized (page) {
						try {
							page.wait(1000);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						log.info("等待订单产生.....");
					}
				}
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("点击下一步加载action.....");
			}
		}
		
		return returnValue;
	}
	
	//里程订单信用卡发送验证码
	@Override
	public CsairReturnValue xykPayLCOrderYzm(String accountNo, String eXPIREMONTH, String eXPIREYEAR, String cvv,
			String buyerName, String idCard, String mobile) {
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = orderLCPaymentPage.getHtmlPage();
		List<HtmlElement> hes = page.getBody().getElementsByAttribute("div","class", "pay-way-name");
		HtmlElement he = null;
		for (int i = 0; i < hes.size(); i++) {
			he = hes.get(i);
			if(he.asText().contains("快捷支付")) {
				clickHandler(he);
			}
		}
		
		HtmlUnorderedList ul = (HtmlUnorderedList) page.getElementById("Credit_Card_Payment ");
		orderPaymentPage.setParent(ul);
		
		HtmlElement borrowCardRadio = ul.getFirstByXPath("//input[@id='raCredit']");
		clickHandler(borrowCardRadio);

		HtmlInput accountNoInput = ul.getFirstByXPath("//input[@id='ACCOUNTNO']");
		accountNoInput.setValueAttribute(accountNo);
		
		HtmlSelect expiremonthSelect = ul.getFirstByXPath("//select[@id='EXPIREMONTH']");
		HtmlOption expiremonthOption = expiremonthSelect.getOptionByText(eXPIREMONTH);
		expiremonthOption.setSelected(true);
		
		HtmlSelect expireyearSelect = ul.getFirstByXPath("//select[@id='EXPIREYEAR']");
		HtmlOption expireyearOption = expireyearSelect.getOptionByText(eXPIREYEAR);
		expireyearOption.setSelected(true);
		
		HtmlInput CVVInput = ul.getFirstByXPath("//input[@id='CVV']");
		CVVInput.setValueAttribute(cvv);

		HtmlInput buyerNameInput = ul.getFirstByXPath("//input[@id='BUYERNAME']");
		buyerNameInput.setValueAttribute(buyerName);

		HtmlInput idCardInput = ul.getFirstByXPath("//input[@id='IDCARD']");
		idCardInput.setValueAttribute(idCard);

		HtmlInput mobileInput = ul.getFirstByXPath("//input[@id='MOBILE']");
		mobileInput.setValueAttribute(mobile);

		HtmlElement codeButton = ul.getFirstByXPath("//input[@id='buttonForCode']");
		codeButton.removeAttribute("disabled");
		clickHandler(codeButton);
		for (int i = 0; i <= timeoutmax; i++) {
			if (!"".equals(page.getElementById("phoneTips").asText().trim())) {
				log.info("----------加载验证信息------------------");
				String codeMsg = page.getElementById("phoneTips").asText().trim();
				returnValue.setMessage(codeMsg);
				return returnValue;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {

					e.printStackTrace();
				}
				log.info("----------加载验证信息ing------------------");
			}
		}
		returnValue.setMessage("验证信息加载失败!!");
		log.info("验证信息加载失败!!");
		return returnValue;
	}

	//里程支付借记卡发送验证码
	@Override
	public CsairReturnValue payLCOrderYzm(String accountNo, String buyerName, String idCard, String mobile) {
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = orderLCPaymentPage.getHtmlPage();
		List<HtmlElement> hes = page.getBody().getElementsByAttribute("div","class", "pay-way-name");
		HtmlElement he = null;
		for (int i = 0; i < hes.size(); i++) {
			he = hes.get(i);
			if(he.asText().contains("快捷支付")) {
				clickHandler(he);
			}
		}
		
		HtmlUnorderedList ul = (HtmlUnorderedList) page.getElementById("Credit_Card_Payment ");
		orderPaymentPage.setParent(ul);
		
		HtmlElement borrowCardRadio = ul.getFirstByXPath("//input[@id='borrowCard']");
		clickHandler(borrowCardRadio);

		HtmlInput accountNoInput = ul.getFirstByXPath("//input[@id='ACCOUNTNO']");
		accountNoInput.setValueAttribute(accountNo);

		HtmlInput buyerNameInput = ul.getFirstByXPath("//input[@id='BUYERNAME']");
		buyerNameInput.setValueAttribute(buyerName);

		HtmlInput idCardInput = ul.getFirstByXPath("//input[@id='IDCARD']");
		idCardInput.setValueAttribute(idCard);

		HtmlInput mobileInput = ul.getFirstByXPath("//input[@id='MOBILE']");
		mobileInput.setValueAttribute(mobile);

		HtmlElement codeButton = ul.getFirstByXPath("//input[@id='buttonForCode']");
		codeButton.removeAttribute("disabled");
		clickHandler(codeButton);
		for (int i = 0; i <= timeoutmax; i++) {
			if (scl.payYzm != null && !"".equals(page.getElementById("phoneTips").asText().trim())) {
				log.info("---------获取验证信息------------------");
				String codeMsg = page.getElementById("phoneTips").asText().trim();
				returnValue.setMessage(codeMsg);
				return returnValue;
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {

					e.printStackTrace();
				}
				log.info("----------加载验证信息ing------------------");
			}
		}
		returnValue.setMessage("验证信息加载失败!!");
		log.info("验证信息加载失败!!");
		return returnValue;
	}

	//里程兑换信用卡支付
	@Override
	public CsairReturnValue xykQueryAndPayLCOrder(String codeName, String expiremonth, String expireyear) {
		scl.URLpayComplete = null;
		scl.URLpayErro = null;
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = orderLCPaymentPage.getHtmlPage();
		try {
			Thread.sleep(200);
		} catch (InterruptedException e1) {
			e1.printStackTrace();
		}
		HtmlDivision div = page.getFirstByXPath("//div[@class='credit1']");
//		log.info("div========>" + div.asXml());
		HtmlInput codeNameInput = (HtmlInput) page.getElementById("CODENAME"); // 验证码
		codeNameInput.setValueAttribute(codeName);
		
		HtmlSelect expiremonthSelect = (HtmlSelect) page.getElementById("EXPIREMONTH");
		HtmlOption expiremonthOption = expiremonthSelect.getOptionByValue(expiremonth);
		expiremonthOption.setSelected(true);
		expiremonthOption.type(9);
		
		HtmlSelect expireyearSelect = (HtmlSelect) page.getElementById("EXPIREYEAR");
		HtmlOption expireyearOption = expireyearSelect.getOptionByValue(expireyear);
		expireyearOption.setSelected(true);
		expireyearOption.type(9);

		HtmlInput payButton = page.getElementByName("upp_pay_btn"); // 执行支付按钮
		page = clickHandler(payButton);
		HtmlDivision alert_msg_box = (HtmlDivision) page.getElementById("alert_msg_box");
		if(alert_msg_box != null) {
			String style = alert_msg_box.getAttribute("style");
			if(!style.contains("none")) {
				HtmlButton milSureButton = (HtmlButton) page.getElementById("milSure");
				clickHandler(milSureButton);
			}
		}
		HtmlDivision popboxDiv = (HtmlDivision) page.getElementById("popbox");
		HtmlSpan alertSpan = (HtmlSpan) page.getBody().getElementsByAttribute("span", "class", "info2").get(0);
		HtmlDivision alertDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "infodt").get(0);
		for (int i = 0; i <= timeoutmax; i++) {
			if (!popboxDiv.getAttribute("class").contains("hide")) {
				returnValue.setMessage(alertSpan.asText() + "," + alertDiv.asText());
				log.info("alertDiv.asText()===>" + alertSpan.asText() + "," + alertDiv.asText());
				returnValue.setState(CS.FAIL);
				
				clickHandler(page.getElementById("btnsty1"));
				return returnValue;
			} else if (scl.URLpayComplete != null) {
				returnValue.setMessage("支付成功!");
				returnValue.setState(CS.SUCCESS);
				log.info("完成支付!!");
				return returnValue;
			} else if (scl.URLpayErro != null) {
				returnValue.setMessage("支付失败!");
				returnValue.setCheckmodel(Boolean.TRUE);
				log.info("支付失败!!");
				returnValue.setState(CS.FAIL);
				return returnValue;
			}

			synchronized (page) {
				try {
					page.wait(1000);
				} catch (InterruptedException e) {

					e.printStackTrace();
				}
				log.info("支付信息加载中........");
			}
		}
		returnValue.setMessage("支付失败");
		log.info("支付失败");
		returnValue.setState(CS.FAIL);
		return returnValue;

	}

	//里程兑换借记卡支付
	@Override
	public CsairReturnValue queryAndPayLCOrder(String codeName) {
		scl.URLpayComplete = null;
		scl.URLpayErro = null;
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = orderLCPaymentPage.getHtmlPage();
		try {
			Thread.sleep(200);
		} catch (InterruptedException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
//		HtmlDivision div = page.getFirstByXPath("//div[@class='credit1']");
//		log.info("div========>" + div.asXml());
//		HtmlInput borrowCardRadio = (HtmlInput) page.getElementById("borrowCard");
//		clickHandler(borrowCardRadio);
//		log.info(page.asXml());
		
		HtmlInput codeNameInput = (HtmlInput) page.getElementById("CODENAME"); // 验证码
		codeNameInput.setValueAttribute(codeName);

		HtmlInput payButton = page.getElementByName("upp_pay_btn"); // 执行支付按钮
		page = clickHandler(payButton);
		HtmlDivision alert_msg_box = (HtmlDivision) page.getElementById("alert_msg_box");
		if(alert_msg_box != null) {
			String style = alert_msg_box.getAttribute("style");
			if(!style.contains("none")) {
				log.info("11111111111111111111");
				HtmlButton milSureButton = (HtmlButton) page.getElementById("milSure");
				clickHandler(milSureButton);
			}
		}
		HtmlDivision popboxDiv = (HtmlDivision) page.getElementById("popbox");
		HtmlSpan alertSpan = (HtmlSpan) page.getBody().getElementsByAttribute("span", "class", "info2").get(0);
		HtmlDivision alertDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "infodt").get(0);
		for (int i = 0; i <= timeoutmax; i++) {
			if (!popboxDiv.getAttribute("class").contains("hide")) {
				returnValue.setMessage(alertSpan.asText() + "," + alertDiv.asText());
				log.info("alertDiv.asText()===>" + alertSpan.asText() + "," + alertDiv.asText());
				returnValue.setState(CS.FAIL);
				
				clickHandler(page.getElementById("btnsty1"));
				return returnValue;
			} else if (scl.URLpayComplete != null) {
				returnValue.setMessage("支付成功!");
				returnValue.setState(CS.SUCCESS);
				log.info("完成支付!!");
				return returnValue;
			} else if (scl.URLpayErro != null) {
				returnValue.setMessage("支付失败!");
				returnValue.setCheckmodel(Boolean.TRUE);
				log.info("支付失败!!");
				returnValue.setState(CS.FAIL);
				return returnValue;
			}

			synchronized (page) {
				try {
					page.wait(1000);
				} catch (InterruptedException e) {

					e.printStackTrace();
				}
				log.info("支付信息加载中........");
			}
		}
		returnValue.setMessage("支付失败");
		log.info("支付失败");
		returnValue.setState(CS.FAIL);
		return returnValue;
	}


	
	
	/**
	 * 加载获取里程-飞行里程-南方航空页面
	 */
	@Override
	public Map<String, Object> nanFangHangKong() {
		Map<String, Object> map = new HashMap<String, Object>();
		nanFangHangKongPage = webClient.getCsairHtmlPage(Csair.nanFangHangKongPage, "nanFangHangKongPage", false);
		HtmlPage page = nanFangHangKongPage.getHtmlPage();
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				doc.select("img").remove();
				map.put("nanFangHangKongContent", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("南方航空页面加载中........");
			}
		}
		return map;
	}
	
	/**
	 * 加载获取里程-飞行里程-天合联盟页面
	 */
	@Override
	public Map<String, Object> tianHeLianMengHangKongPage() {
		Map<String, Object> map = new HashMap<String, Object>();
		tianHeLianMengHangKongPage = webClient.getCsairHtmlPage(Csair.tianHeLianMengHangKongPage, "tianHeLianMengHangKongPage", false);
		HtmlPage page = tianHeLianMengHangKongPage.getHtmlPage();
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				doc.select("img").remove();
				map.put("tianHeLianMengHangKongContent", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("天合联盟页面加载中........");
			}
		}
		return map;
	}
	/**
	 * 加载获取里程-飞行里程-其他合作伙伴页面
	 */
	@Override
	public Map<String, Object> othersPage() {
		Map<String, Object> map = new HashMap<String, Object>();
		othersPage = webClient.getCsairHtmlPage(Csair.othersPage, "othersPage", false);
		HtmlPage page = othersPage.getHtmlPage();
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				doc.select("img").remove();
				map.put("othersPageContent", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("其他合作伙伴页面加载中........");
			}
		}
		return map;
	}
	
	/**
	 * 加载酒店里程页面
	 */
	@Override
	public Map<String, Object> hotelMileagePage() {
		Map<String, Object> map = new HashMap<String, Object>();
		List<Document> hotelMileagePageContentList = new ArrayList<Document>();
		hotelMileage = webClient.getCsairHtmlPage(Csair.hotelMileage, "hotelMileage", false);
		HtmlPage page = hotelMileage.getHtmlPage();
		for (int i = 0; i < timeoutmax; i++) {
			List<HtmlElement> nr_hotels = page.getBody().getElementsByAttribute("div", "class", "nr-hotel");
			if(nr_hotels.size() != 0) {
				for (int j = 0; j < nr_hotels.size(); j++) {
					HtmlElement nr_hotel = nr_hotels.get(j);
					Document doc = Jsoup.parse(nr_hotel.asXml());
					doc.select("img").remove();
					hotelMileagePageContentList.add(doc);
				}
				map.put("hotelMileagePageContentList", hotelMileagePageContentList);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("酒店里程页面加载中........");
			}
		}
		return map;
	}

	/**
	 * 加载刷卡里程联名信用卡
	 */
	@Override
	public Map<String, Object> lianMingXinYongKa() {
		Map<String, Object> map = new HashMap<String, Object>();
		List<Document> lianMingXinYongKaContentList = new ArrayList<Document>();
		lianMingXinYongKa = webClient.getCsairHtmlPage(Csair.lianMingXinYongKa, "lianMingXinYongKa", false);
		HtmlPage page = lianMingXinYongKa.getHtmlPage();
		for (int i = 0; i < timeoutmax; i++) {
			List<HtmlElement> nr_hotels = page.getBody().getElementsByAttribute("div", "class", "nr-hotel");
			if(nr_hotels.size() != 0) {
				for (int j = 0; j < nr_hotels.size(); j++) {
					HtmlElement nr_hotel = nr_hotels.get(j);
					Document doc = Jsoup.parse(nr_hotel.asXml());
					doc.select("img").remove();
					lianMingXinYongKaContentList.add(doc);
				}
				map.put("lianMingXinYongKaContentList", lianMingXinYongKaContentList);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("联名信用卡页面加载中........");
			}
		}
		return map;
	}
	
	/**
	 * 加载银行积分兑换页面
	 */
	@Override
	public Map<String, Object> yinHangJiFenDuiHuan() {
		Map<String, Object> map = new HashMap<String, Object>();
		List<Document> yinHangJiFenDuiHuanContentList = new ArrayList<Document>();
		yinHangJiFenDuiHuan = webClient.getCsairHtmlPage(Csair.yinHangJiFenDuiHuan, "yinHangJiFenDuiHuan", false);
		HtmlPage page = yinHangJiFenDuiHuan.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			List<HtmlElement> nr_hotels = page.getBody().getElementsByAttribute("div", "class", "nr-hotel");
			if(nr_hotels.size() != 0) {
				for (int j = 0; j < nr_hotels.size(); j++) {
					HtmlElement nr_hotel = nr_hotels.get(j);
					Document doc = Jsoup.parse(nr_hotel.asXml());
					doc.select("img").remove();
					yinHangJiFenDuiHuanContentList.add(doc);
				}
				map.put("yinHangJiFenDuiHuanContentList", yinHangJiFenDuiHuanContentList);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("银行积分兑换页面加载中........");
			}
		}
		return map;
	}

	/**
	 * 加载其他合作伙伴里程租车
	 */
	@Override
	public Map<String, Object> zuChe() {
		Map<String, Object> map = new HashMap<String, Object>();
		List<Document> zuCheContentList = new ArrayList<Document>();
		zuChe = webClient.getCsairHtmlPage(Csair.zuChe, "zuChe", false);
		HtmlPage page = zuChe.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			List<HtmlElement> nr_hotels = page.getBody().getElementsByAttribute("div", "class", "nr-hotel");
			if(nr_hotels.size() != 0) {
				for (int j = 0; j < nr_hotels.size(); j++) {
					HtmlElement nr_hotel = nr_hotels.get(j);
					Document doc = Jsoup.parse(nr_hotel.asXml());
					doc.select("img").remove();
					zuCheContentList.add(doc);
				}
				map.put("zuCheContentList", zuCheContentList);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载其他合作伙伴里程租车........");
			}
		}
		return map;
	}
	
	/**
	 * 加载其他合作伙伴里程商旅
	 */
	@Override
	public Map<String, Object> shangLv() {
		Map<String, Object> map = new HashMap<String, Object>();
		List<Document> shangLvContentList = new ArrayList<Document>();
		shangLv = webClient.getCsairHtmlPage(Csair.shangLv, "shangLv", false);
		HtmlPage page = shangLv.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			List<HtmlElement> nr_hotels = page.getBody().getElementsByAttribute("div", "class", "nr-hotel");
			if(nr_hotels.size() != 0) {
				for (int j = 0; j < nr_hotels.size(); j++) {
					HtmlElement nr_hotel = nr_hotels.get(j);
					Document doc = Jsoup.parse(nr_hotel.asXml());
					doc.select("img").remove();
					shangLvContentList.add(doc);
				}
				map.put("shangLvContentList", shangLvContentList);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载其他合作伙伴里程商旅........");
			}
		}
		return map;
	}
	/**
	 * 加载其他合作伙伴里程餐饮
	 */
	@Override
	public Map<String, Object> canYin() {
		Map<String, Object> map = new HashMap<String, Object>();
		List<Document> canYinContentList = new ArrayList<Document>();
		canYin = webClient.getCsairHtmlPage(Csair.canYin, "canYin", false);
		HtmlPage page = canYin.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			List<HtmlElement> nr_hotels = page.getBody().getElementsByAttribute("div", "class", "nr-hotel");
			if(nr_hotels.size() != 0) {
				for (int j = 0; j < nr_hotels.size(); j++) {
					HtmlElement nr_hotel = nr_hotels.get(j);
					Document doc = Jsoup.parse(nr_hotel.asXml());
					doc.select("img").remove();
					canYinContentList.add(doc);
				}
				map.put("canYinContentList", canYinContentList);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载其他合作伙伴里程餐饮........");
			}
		}
		return map;
	}
	
	/**
	 * 加载其他合作伙伴里程其他
	 */
	@Override
	public Map<String, Object> qiTa() {
		Map<String, Object> map = new HashMap<String, Object>();
		List<Document> qiTaContentList = new ArrayList<Document>();
		qiTa = webClient.getCsairHtmlPage(Csair.qiTa, "qiTa", false);
		HtmlPage page = qiTa.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			List<HtmlElement> nr_hotels = page.getBody().getElementsByAttribute("div", "class", "nr-hotel");
			if(nr_hotels.size() != 0) {
				for (int j = 0; j < nr_hotels.size(); j++) {
					HtmlElement nr_hotel = nr_hotels.get(j);
					Document doc = Jsoup.parse(nr_hotel.asXml());
					doc.select("img").remove();
					qiTaContentList.add(doc);
				}
				map.put("qiTaContentList", qiTaContentList);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载其他合作伙伴里程其他........");
			}
		}
		return map;
	}

	/**
	 * 加载里程补登
	 */
	@Override
	public Map<String, Object> mileageSupplementPage() {
		Map<String, Object> map = new HashMap<String, Object>();
		mileageSupplementPage = webClient.getCsairHtmlPage(Csair.mileageSupplementPage, "mileageSupplementPage", false);
		HtmlPage page = mileageSupplementPage.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				doc.select("img").remove();
				map.put("mileageSupplementContent", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载里程补登........");
			}
		}
		return map;
	}
	/**
	 * 加载里程延期
	 */
	@Override
	public Map<String, Object> mileageDelayPage() {
		Map<String, Object> map = new HashMap<String, Object>();
		mileageDelayPage = webClient.getCsairHtmlPage(Csair.mileageDelayPage, "mileageDelayPage", false);
		HtmlPage page = mileageDelayPage.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				doc.select("img").remove();
				doc.select("p").last().remove();
				map.put("mileageDelayContent", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载里程延期........");
			}
		}
		return map;
	}
	/**
	 * 加载高端礼遇
	 */
	@Override
	public Map<String, Object> h_courtesyPage() {
		Map<String, Object> map = new HashMap<String, Object>();
		h_courtesyPage = webClient.getCsairHtmlPage(Csair.h_courtesyPage, "h_courtesyPage", false);
		HtmlPage page = h_courtesyPage.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				doc.select("img").remove();
				map.put("Content", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载高端礼遇........");
			}
		}
		return map;
	}

	/**
	 * 加载短信定制明珠会员尊享短信功能
	 */
	@Override
	public Map<String, Object> SMSfunction() {
		Map<String, Object> map = new HashMap<String, Object>();
		SMSfunction = webClient.getCsairHtmlPage(Csair.SMSfunction, "SMSfunction", false);
		HtmlPage page = SMSfunction.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				doc.select("img").remove();
				map.put("Content", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载短信定制明珠会员尊享短信功能........");
			}
		}
		return map;
	}
	/**
	 * 加载短信定制短信值机
	 */
	@Override
	public Map<String, Object> SMSonDuty() {
		Map<String, Object> map = new HashMap<String, Object>();
		SMSonDuty = webClient.getCsairHtmlPage(Csair.SMSonDuty, "SMSonDuty", false);
		HtmlPage page = SMSonDuty.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				doc.select("img").remove();
				map.put("Content", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载短信定制短信值机........");
			}
		}
		return map;
	}
	/**
	 * 加载短信定制短信入会
	 */
	@Override
	public Map<String, Object> SMSadmission() {
		Map<String, Object> map = new HashMap<String, Object>();
		SMSadmission = webClient.getCsairHtmlPage(Csair.SMSadmission, "SMSadmission", false);
		HtmlPage page = SMSadmission.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				doc.select("img").remove();
				map.put("Content", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载短信定制短信入会........");
			}
		}
		return map;
	}
	/**
	 * 加载便捷签证
	 */
	@Override
	public Map<String, Object> visaPage() {
		Map<String, Object> map = new HashMap<String, Object>();
		visaPage = webClient.getCsairHtmlPage(Csair.visaPage, "visaPage", false);
		HtmlPage page = visaPage.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				doc.select("img").remove();
				map.put("Content", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载便捷签证........");
			}
		}
		return map;
	}
	/**
	 * 加载明珠礼遇
	 */
	@Override
	public Map<String, Object> mz_courtesyPage() {
		Map<String, Object> map = new HashMap<String, Object>();
		mz_courtesyPage = webClient.getCsairHtmlPage(Csair.mz_courtesyPage, "mz_courtesyPage", false);
		HtmlPage page = mz_courtesyPage.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision qjDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "qj").get(0);
			if(qjDiv != null) {
				Document doc = Jsoup.parse(qjDiv.asXml());
				doc.select(".imgs").remove();
				doc.select("img").remove();
				map.put("Content", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载明珠礼遇........");
			}
		}
		return map;
	}
	/**
	 * 加载简介
	 */
	@Override
	public Map<String, Object> introductionPage() {
		Map<String, Object> map = new HashMap<String, Object>();
		introductionPage = webClient.getCsairHtmlPage(Csair.introductionPage, "introductionPage", false);
		HtmlPage page = introductionPage.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				doc.select("img").remove();
				map.put("Content", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载简介........");
			}
		}
		return map;
	}
	/**
	 * 加载会员级别
	 */
	@Override
	public Map<String, Object> membershipLevelPage() {
		Map<String, Object> map = new HashMap<String, Object>();
		membershipLevelPage = webClient.getCsairHtmlPage(Csair.membershipLevelPage, "membershipLevelPage", false);
		HtmlPage page = membershipLevelPage.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				doc.select("img").remove();
				map.put("Content", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载会员级别........");
			}
		}
		return map;
	}

	/**
	 * 加载会员权益
	 */
	@Override
	public Map<String, Object> membershipRightsPage() {
		Map<String, Object> map = new HashMap<String, Object>();
		membershipRightsPage = webClient.getCsairHtmlPage(Csair.membershipRightsPage, "membershipRightsPage", false);
		HtmlPage page = membershipRightsPage.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				doc.select("img").remove();
				map.put("Content", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载会员权益........");
			}
		}
		return map;
	}

	/**
	 * 加载天合优享
	 */
	@Override
	public Map<String, Object> tianheEnjoy() {
		Map<String, Object> map = new HashMap<String, Object>();
		tianheEnjoy = webClient.getCsairHtmlPage(Csair.tianheEnjoy, "tianheEnjoy", false);
		HtmlPage page = tianheEnjoy.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				doc.select("img.isUsHide").remove();
				map.put("Content", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载天合优享........");
			}
		}
		return map;
	}

	/**
	 * 点击促销信息默认加载热点活动列表
	 */
	@Override
	public Map<String, Object> hotActivity() {
		String urlBefore = "http://skypearl.csair.com/cn/newsletter/";
		Map<String, Object> map = new HashMap<String, Object>();
		hotActivity = webClient.getCsairHtmlPage(Csair.hotActivity, "hotActivity", false);
		HtmlPage page = hotActivity.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				Elements as = doc.select(".newsklinul li a");
				log.info("as.size()====>"+as.size());
				for (int j = 0; j < as.size(); j++) {
					Element a = as.get(j);
					String ahref = a.attr("href");
					String newAhref = urlBefore + ahref;
					a.attr("data",newAhref);
					a.attr("href","javascript:void(0)");
				}
				map.put("Content", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载热点促销列表........");
			}
		}
		return map;
	}

	/**
	 * 加载航班促销列表
	 */
	@Override
	public Map<String, Object> lines() {
		String urlBefore = "http://skypearl.csair.com/cn/newsletter/";
		Map<String, Object> map = new HashMap<String, Object>();
		lines = webClient.getCsairHtmlPage(Csair.lines, "lines", false);
		HtmlPage page = lines.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				Elements as = doc.select(".newsklinul li a");
				for (int j = 0; j < as.size(); j++) {
					Element a = as.get(j);
					String ahref = a.attr("href");
					String newAhref = urlBefore + ahref;
					a.attr("data",newAhref);
					a.attr("href","javascript:void(0)");
					a.attr("class","spearlLink");
				}
				map.put("Content", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载航班促销列表........");
			}
		}
		return map;
	}
	/**
	 * 加载银行列表
	 */
	@Override
	public Map<String, Object> banking() {
		String urlBefore = "http://skypearl.csair.com/cn/newsletter/";
		Map<String, Object> map = new HashMap<String, Object>();
		banking = webClient.getCsairHtmlPage(Csair.banking, "banking", false);
		HtmlPage page = banking.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				Elements as = doc.select(".newsklinul li a");
				for (int j = 0; j < as.size(); j++) {
					Element a = as.get(j);
					String ahref = a.attr("href");
					String newAhref = urlBefore + ahref;
					a.attr("data",newAhref);
					a.attr("href","javascript:void(0)");
					a.attr("class","spearlLink");
				}
				map.put("Content", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载银行列表........");
			}
		}
		return map;
	}

	/**
	 * 加载酒店列表
	 */
	@Override
	public Map<String, Object> hotels() {
		String urlBefore = "http://skypearl.csair.com/cn/newsletter/";
		Map<String, Object> map = new HashMap<String, Object>();
		hotels = webClient.getCsairHtmlPage(Csair.hotels, "hotels", false);
		HtmlPage page = hotels.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				Elements as = doc.select(".newsklinul li a");
				for (int j = 0; j < as.size(); j++) {
					Element a = as.get(j);
					String ahref = a.attr("href");
					String newAhref = urlBefore + ahref;
					a.attr("data",newAhref);
					a.attr("href","javascript:void(0)");
					a.attr("class","spearlLink");
				}
				map.put("Content", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载酒店列表........");
			}
		}
		return map;
	}

	/**
	 * 加载租车列表
	 */
	@Override
	public Map<String, Object> cars() {
		String urlBefore = "http://skypearl.csair.com/cn/newsletter/";
		Map<String, Object> map = new HashMap<String, Object>();
		cars = webClient.getCsairHtmlPage(Csair.cars, "cars", false);
		HtmlPage page = cars.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				Elements as = doc.select(".newsklinul li a");
				for (int j = 0; j < as.size(); j++) {
					Element a = as.get(j);
					String ahref = a.attr("href");
					String newAhref = urlBefore + ahref;
					a.attr("data",newAhref);
					a.attr("href","javascript:void(0)");
					a.attr("class","spearlLink");
				}
				map.put("Content", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载租车列表........");
			}
		}
		return map;
	}

	/**
	 * 加载旅游列表
	 */
	@Override
	public Map<String, Object> travels() {
		String urlBefore = "http://skypearl.csair.com/cn/newsletter/";
		Map<String, Object> map = new HashMap<String, Object>();
		travels = webClient.getCsairHtmlPage(Csair.travels, "travels", false);
		HtmlPage page = travels.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				Elements as = doc.select(".newsklinul li a");
				for (int j = 0; j < as.size(); j++) {
					Element a = as.get(j);
					String ahref = a.attr("href");
					String newAhref = urlBefore + ahref;
					a.attr("data",newAhref);
					a.attr("href","javascript:void(0)");
					a.attr("class","spearlLink");
				}
				map.put("Content", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载旅游列表........");
			}
		}
		return map;
	}

	/**
	 * 加载酒店预订网列表
	 */
	@Override
	public Map<String, Object> booking() {
		String urlBefore = "http://skypearl.csair.com/cn/newsletter/";
		Map<String, Object> map = new HashMap<String, Object>();
		booking = webClient.getCsairHtmlPage(Csair.booking, "booking", false);
		HtmlPage page = booking.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				Elements as = doc.select(".newsklinul li a");
				for (int j = 0; j < as.size(); j++) {
					Element a = as.get(j);
					String ahref = a.attr("href");
					String newAhref = urlBefore + ahref;
					a.attr("data",newAhref);
					a.attr("href","javascript:void(0)");
					a.attr("class","spearlLink");
				}
				map.put("Content", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载酒店预订网列表........");
			}
		}
		return map;
	}

	/**
	 * 加载其他列表
	 */
	@Override
	public Map<String, Object> others() {
		String urlBefore = "http://skypearl.csair.com/cn/newsletter/";
		Map<String, Object> map = new HashMap<String, Object>();
		others = webClient.getCsairHtmlPage(Csair.others, "others", false);
		HtmlPage page = others.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				Elements as = doc.select(".newsklinul li a");
				for (int j = 0; j < as.size(); j++) {
					Element a = as.get(j);
					String ahref = a.attr("href");
					String newAhref = urlBefore + ahref;
					a.attr("data",newAhref);
					a.attr("href","javascript:void(0)");
					a.attr("class","spearlLink");
				}
				map.put("Content", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载其他列表........");
			}
		}
		return map;
	}


	/**
	 * 俱乐部消息
	 */
	@Override
	public Map<String, Object> loadclubInfo() {
		String urlBefore = "http://skypearl.csair.com/cn/newsletter/";
		Map<String, Object> map = new HashMap<String, Object>();
		clubInfo = webClient.getCsairHtmlPage(Csair.clubInfo, "clubInfo", false);
		HtmlPage page = clubInfo.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision mknrDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "mknr").get(0);
			if(mknrDiv != null) {
				Document doc = Jsoup.parse(mknrDiv.asXml());
				Elements as = doc.select(".newsklinul li a");
				for (int j = 0; j < as.size(); j++) {
					Element a = as.get(j);
					String ahref = a.attr("href");
					String newAhref = urlBefore + ahref;
					a.attr("data",newAhref);
					a.attr("href","javascript:void(0)");
					a.attr("class","spearlLink");
				}
				map.put("Content", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载俱乐部消息........");
			}
		}
		return map;
	}



	
	/**
	 * 明珠会员中点击列表链接
	 */
	@Override
	public Map<String, Object> clickA(String href) {
		String imgSrcBefore = "http://skypearl.csair.com/cn/";
		Map<String, Object> map = new HashMap<String, Object>();
		lieBiaoContent = webClient.getCsairHtmlPage(href, "lieBiaoContent", false);
		HtmlPage page = lieBiaoContent.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			List<HtmlElement> mknrDivs = page.getBody().getElementsByAttribute("div", "class", "mknr");
			if(mknrDivs.size() != 0) {
				HtmlDivision mknrDiv = (HtmlDivision) mknrDivs.get(0);
				Document doc = Jsoup.parse(mknrDiv.asXml());
				Elements imgs = doc.select("img");
				for (int j = 0; j < imgs.size(); j++) {
					Element img = imgs.get(j);
					String imgSrc = img.attr("src");
					imgSrc = imgSrc.replace("../../", imgSrcBefore);
					img.attr("src",imgSrc);
				}
				
				//判断列表内容是否又是列表
				Elements newsklinul = doc.select(".newsklinul");
				if(newsklinul.size() != 0) {
					String urlBefore = "http://skypearl.csair.com/cn/newsletter/";
					Elements as = doc.select(".newsklinul li a");
					for (int j = 0; j < as.size(); j++) {
						Element a = as.get(j);
						String ahref = a.attr("href");
						String newAhref = urlBefore + ahref;
						a.attr("data",newAhref);
						a.attr("href","javascript:void(0)");
						a.attr("class","spearlLink");
					}
				}
				map.put("Content", doc);
				return map;
			}
			if(href.equals("http://skypearl.csair.com/cn/newsletter/2018/20180102/southern/index.html")) {
				imgSrcBefore = "http://skypearl.csair.com/cn/newsletter/2018/20180102/southern/";
				List<HtmlElement> partDivs = page.getBody().getElementsByAttribute("div", "class", "part");
				if(partDivs.size() != 0) {
					HtmlDivision partDiv = (HtmlDivision) partDivs.get(0);
					Document doc = Jsoup.parse(partDiv.asXml());
					Elements imgs = doc.select("img");
					for (int j = 0; j < imgs.size(); j++) {
						Element img = imgs.get(j);
						String imgSrc = img.attr("src");
						imgSrc = imgSrcBefore + imgSrc;
						img.attr("src",imgSrc);
					}
					doc.select("img.pc-show").remove();
					//判断列表内容是否又是列表
					Elements newsklinul = doc.select(".newsklinul");
					if(newsklinul.size() != 0) {
						String urlBefore = "http://skypearl.csair.com/cn/newsletter/";
						Elements as = doc.select(".newsklinul li a");
						for (int j = 0; j < as.size(); j++) {
							Element a = as.get(j);
							String ahref = a.attr("href");
							String newAhref = urlBefore + ahref;
							a.attr("data",newAhref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}
					}
					map.put("Content", doc);
					return map;
				}
			}
			if(href.equals("http://skypearl.csair.com/cn/newsletter/2017/0922/index.html")) {
				imgSrcBefore = "http://skypearl.csair.com/cn/newsletter/2017/0922/";
				List<HtmlElement> tab_contents = page.getBody().getElementsByAttribute("div", "class", "tab_content");
				if(tab_contents.size() != 0) {
					HtmlDivision tab_content = (HtmlDivision) tab_contents.get(0);
					Document doc = Jsoup.parse(tab_content.asXml());
					Elements imgs = doc.select("img");
					for (int j = 0; j < imgs.size(); j++) {
						Element img = imgs.get(j);
						String imgSrc = img.attr("src");
						imgSrc = imgSrcBefore + imgSrc;
						img.attr("src",imgSrc);
					}
					doc.select("img.pc-show").remove();
					//判断列表内容是否又是列表
					Elements newsklinul = doc.select(".newsklinul");
					if(newsklinul.size() != 0) {
						String urlBefore = "http://skypearl.csair.com/cn/newsletter/";
						Elements as = doc.select(".newsklinul li a");
						for (int j = 0; j < as.size(); j++) {
							Element a = as.get(j);
							String ahref = a.attr("href");
							String newAhref = urlBefore + ahref;
							a.attr("data",newAhref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}
					}
					map.put("Content", doc);
					return map;
				}
			}
			if(href.equals("http://skypearl.csair.com/cn/newsletter/2017/0804/bsid.shtml")) {
				imgSrcBefore = "http://skypearl.csair.com/cn/newsletter/2017/0804/";
				List<HtmlElement> bs_bss = page.getBody().getElementsByAttribute("div", "class", "bs_bs");
				if(bs_bss.size() != 0) {
					HtmlDivision bs_bs = (HtmlDivision) bs_bss.get(0);
					Document doc = Jsoup.parse(bs_bs.asXml());
					Elements imgs = doc.select("img");
					for (int j = 0; j < imgs.size(); j++) {
						Element img = imgs.get(j);
						String imgSrc = img.attr("src");
						imgSrc = imgSrcBefore + imgSrc;
						img.attr("src",imgSrc);
					}
					doc.select("img.pc-show").remove();
					//判断列表内容是否又是列表
					Elements newsklinul = doc.select(".newsklinul");
					if(newsklinul.size() != 0) {
						String urlBefore = "http://skypearl.csair.com/cn/newsletter/";
						Elements as = doc.select(".newsklinul li a");
						for (int j = 0; j < as.size(); j++) {
							Element a = as.get(j);
							String ahref = a.attr("href");
							String newAhref = urlBefore + ahref;
							a.attr("data",newAhref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}
					}
					map.put("Content", doc);
					return map;
				}
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载列表内容........");
			}
		}
		return map;
	}

	/**
	 * xss参数过滤
	 * @param value
	 * @return
	 */
	 private static String cleanXSS(String value) {
      //几种常见的web攻击:http://jingyan.baidu.com/article/0202781178e19e1bcc9ce5c7.html
      value = value.replaceAll("<", "&lt;").replaceAll(">", "&gt;");
      //%3C是URL对<字符的编码
      value = value.replaceAll("%3C", "&lt;").replaceAll("%3E", "&gt;");
      value = value.replaceAll("\\(", "&#40;").replaceAll("\\)", "&#41;");
      //%28是(转义后的字符编码 , %29是)转义后的字符编码
      value = value.replaceAll("%28", "&#40;").replaceAll("%29", "&#41;");
      //&#39;是单引号ASCII编码后的表现形式
      value = value.replaceAll("'", "&#39;");
      //eval() 函数可计算某个字符串，并执行其中的的 JavaScript 代码
      value = value.replaceAll("eval\\((.*)\\)", "");
      //防止如javascript:alert(doucment.cookie)可以看到当前站点的cookie（如果有的话）的攻击
      value = value.replaceAll("[\\\"\\\'][\\s]*javascript:(.*)[\\\"\\\']", "\"\"");
  //        value = value.replaceAll("script", "");
      return value;
  }

	/**
	 * 出行帮助中点击链接进行内容加载
	 */
	@Override
	public Map<String, Object> cxbz_clickA(String href) {
		href = cleanXSS(href);
		log.info("href====>"+href);
		lieBiaoContent = null;
		if(href.startsWith("http://www.csair.com/cn/tourguide/airport_service/delay_guide/")) {
			href = "http://www.csair.com/cn/tourguide/airport_service/delay_guide/flightsTwo_hub/";
		}
		if(href.startsWith("http://skypearl.csair.com/cn//cn/about/investor/key-financials/zhongqibaobiao/")) {
			href = "http://www.csair.com/cn/about/investor/key-financials/zhongqibaobiao/";
		}
		if(href.startsWith("http://skypearl.csair.com/cn//cn/about/investor/key-financials/niandubaobiao/")) {
			href = "http://www.csair.com/cn/about/investor/key-financials/niandubaobiao/";
		}
		if(href.startsWith("http://www.csair.com/cn/tourguide/transfers/flightsTwo_hub/transfers/")) {
			href = "http://www.csair.com/cn/tourguide/transfers/flightsTwo_hub/transfers/internation_internation/";
		}
		
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("href", href);
		
//		try {
			lieBiaoContent = webClient.getCsairHtmlPage(href, "lieBiaoContent", false);
//		} catch (FailingHttpStatusCodeException e) {
//			e.addSuppressed(e);
//		}
//		lieBiaoContent = webClient.getCsairHtmlPage(href, "lieBiaoContent", false);
		HtmlPage page = lieBiaoContent.getHtmlPage();
		
		if(href.startsWith("http://www.csair.com/cn/about/investor/key-financials") ) {
			try {
				Thread.sleep(500);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
		if(href.startsWith("http://www.csair.com/cn/tourguide/booking/static/vipsxjg")) {
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
		for (int i = 0; i < timeoutmax; i++) {
			List<HtmlElement> second_rightDivs = page.getBody().getElementsByAttribute("div", "class", "second-right");
			if(second_rightDivs.size() != 0) {
				String urlBefore = "http://www.csair.com";
				HtmlDivision second_rightDiv = (HtmlDivision) second_rightDivs.get(0);
				Document doc = Jsoup.parse(second_rightDiv.asXml());
				doc.select(".current-align").remove();
				doc.select(".search-checkbox").remove();
				doc.select("object").remove();
				Elements lis = doc.select(".city-item-list li");
				if(lis.size() != 0) {
					String liText = lis.last().text();
					if(liText.equals("精选机票")) {
						lis.last().remove();
					}
				}
				doc.select("style").remove();
				doc.select("script").remove();
				doc.select("#dc_sharebar").remove();
				doc.select(".mainbr").remove();
				doc.select(".IAT-Buttons").remove();
				
				if(href.equals("http://www.csair.com/cn/tourguide/airport_service/domestic/domestic/")) {
					doc.select("h4").get(1).remove();
					doc.select(".chabt").remove();
				}
				if(href.equals("http://www.csair.com/cn/tourguide/airport_service/tongguan/")) {
					doc.select("table").attr("class","ccc");
				}
				if(href.equals("http://www.csair.com/cn/tourguide/transfers/flights/free_zhusu/")) {
					doc.select("table").attr("class","ccc");
				}
				if(href.equals("http://www.csair.com/cn/tourguide/faq/baggage/free-baggage-allowance.shtml")) {
					doc.select("table").attr("class","ccc");
				}
				if(href.startsWith("http://www.csair.com/cn/tourguide/transfers")) {
					doc.select("table").attr("class","ccc");
				}
				if(href.startsWith("http://www.csair.com/cn/tourguide/flight_service")) {
					doc.select("table").attr("class","ccc");
				}
				if(href.startsWith("http://www.csair.com/cn/tourguide/special/movement_disorder/")) {
					doc.select("table").attr("class","ccc");
				}
				if(href.startsWith("http://www.csair.com/cn/about/investor/key-financials")){
					for (int j = 0; j < timeoutmax; j++) {
						HtmlTable tb = (HtmlTable) page.getElementById("tb");
						DomNodeList<HtmlElement> tds = tb.getElementsByTagName("td");
						if(tds.size() != 0) {
							doc.select("#container").remove();
							doc.select("#cb").remove();
							doc.select("input[type=checkbox]").remove();
							Elements as = doc.select(".nav-tabs  a");
							for (int j1 = 0; j1 < as.size(); j1++) {
								Element a = as.get(j1);
								String ahref = a.attr("href");
								ahref = urlBefore + ahref ;
								a.attr("data",ahref);
								a.attr("href","javascript:void(0)");
								a.attr("class","spearlLink");
							}
							Elements li2s = doc.select("#fin li");
							for (int i1 = 0; i1 < li2s.size(); i1++) {
								Element li2 = li2s.get(i1);
								String li2Text = li2.text();
								li2.html("<a href='javascript:void(0)'>"+li2Text+"</a>");
							}
							break;
						}
						synchronized (page) {
							try {
								page.wait(500);
							} catch (InterruptedException e) {
								e.printStackTrace();
							}
							log.info("加载表格.......");
						}
					}
				}
				Elements as1 = doc.select(".check-in-list a");
				for (int j = 0; j < as1.size(); j++) {
					Element a = as1.get(j);
					String ahref = a.attr("href");
					if(!ahref.startsWith("http") && !ahref.startsWith("#")) {
						ahref = urlBefore + ahref ;
						a.attr("data",ahref);
						a.attr("href","javascript:void(0)");
						a.attr("class","spearlLink");
					}
				}
				Elements as2 = doc.select(".form-con-list a");
				for (int j = 0; j < as2.size(); j++) {
					Element a = as2.get(j);
					String ahref = a.attr("href");
					if(!ahref.startsWith("http") && !ahref.startsWith("javascript") && !ahref.startsWith("#") && !ahref.endsWith("pdf")&& !ahref.endsWith("pdf/") && !ahref.endsWith(".jpg") && !ahref.endsWith(".zip") && !ahref.endsWith(".png")&& !ahref.endsWith(".xlsx") && !ahref.contains("login.html") && !href.equals("http://www.csair.com/cn/tourguide/experience_center/fullview/cabin/")&& !href.equals("http://www.csair.com/cn/tourguide/experience_center/fullview/vip/")) {
						if(ahref.startsWith("../../../../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 4; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../../../../", hrefStr);
							a.attr("data",ahref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}else if(ahref.startsWith("../../../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 3; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../../../", hrefStr);
							a.attr("data",ahref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}else if(ahref.startsWith("../../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 2; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../../", hrefStr);
							a.attr("data",ahref); 
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}else if(ahref.startsWith("../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 1; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../", hrefStr);
							a.attr("data",ahref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}else if(ahref.startsWith("//")){
							ahref = ahref.replace("//", "http://");
							a.attr("data",ahref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}else if(ahref.startsWith("/")){
							ahref = urlBefore + ahref ;
							a.attr("data",ahref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}else {
							ahref = href + ahref ;
							a.attr("data",ahref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}
						
					}else if(href.equals("http://www.csair.com/cn/tourguide/experience_center/fullview/cabin/") || ahref.endsWith("pdf")|| ahref.endsWith("pdf/") || ahref.contains("login.html") || ahref.endsWith(".jpg") || ahref.endsWith(".zip")|| ahref.endsWith(".png") || ahref.endsWith(".xlsx")) {
						if(ahref.startsWith("../../../../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 4; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../../../../", hrefStr);
							a.attr("href",ahref);
						}else if(ahref.startsWith("../../../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 3; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../../../", hrefStr);
							a.attr("href",ahref);
						}else if(ahref.startsWith("../../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 2; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../../", hrefStr);
							a.attr("href",ahref);
						}else if(ahref.startsWith("../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 1; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../", hrefStr);
							a.attr("href",ahref);
						}else if(ahref.startsWith("//")){
							ahref = ahref.replace("//", "http://");
							a.attr("href",ahref);
						}else if(ahref.startsWith("/")){
							ahref = urlBefore + ahref ;
							a.attr("href",ahref);
						}else {
							if(!href.endsWith("html")) {
								ahref = href + ahref ;
								a.attr("href",ahref);
							}else {
								String hrefStr = "";
								String[] hrefStrs = href.split("/");
								for (int k = 0; k < hrefStrs.length - 1; k++) {
									hrefStr = hrefStr + hrefStrs[k]+"/";
								}
								ahref = hrefStr + ahref;
								a.attr("href",ahref);
							}
						}
					}else if(ahref.startsWith("http://www.csair.com/cn/tourguide")) {
						a.attr("data",ahref);
						a.attr("href","javascript:void(0)");
						a.attr("class","spearlLink");
					}else if(href.equals("http://www.csair.com/cn/tourguide/experience_center/fullview/vip/")) {
						ahref = ahref.replace("/cn/tourguide/experience_center/fullview/vip/../..", "http://www.csair.com/cn/tourguide/experience_center");
						a.attr("href",ahref);
					}
					String adata = a.attr("data");
					if(adata.contains("foodMenu.jsp?")) {
						ahref = adata;
						a.attr("href",ahref);
						a.attr("data","");
					}
				}
				Elements as3 = doc.select(".dc_left a");
				for (int j = 0; j < as3.size(); j++) {
					Element a = as3.get(j);
					String ahref = a.attr("href");
					if(!ahref.startsWith("http") && !ahref.startsWith("javascript") && !ahref.startsWith("#") && !ahref.endsWith(".pdf") && !ahref.endsWith(".jpg") && !ahref.endsWith(".zip") && !ahref.endsWith(".png") && !ahref.endsWith(".xlsx") && !ahref.contains("login.html") && !ahref.equals("")) {
						if(ahref.startsWith("../../../../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 4; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../../../../", hrefStr);
							a.attr("data",ahref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}else if(ahref.startsWith("../../../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 3; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../../../", hrefStr);
							a.attr("data",ahref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}else if(ahref.startsWith("../../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 2; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../../", hrefStr);
							a.attr("data",ahref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}else if(ahref.startsWith("../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 1; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../", hrefStr);
							a.attr("data",ahref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}else if(ahref.startsWith("//")){
							ahref = ahref.replace("//", "http://");
							a.attr("data",ahref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}else if(ahref.startsWith("/")){
							ahref = urlBefore + ahref ;
							a.attr("data",ahref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}else {
							ahref = href + ahref ;
							a.attr("data",ahref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}
					}else if(ahref.endsWith(".pdf") || ahref.contains("login.html") || ahref.endsWith(".jpg") || ahref.endsWith(".zip")|| ahref.endsWith(".png")|| ahref.endsWith(".xlsx")) {
						if(ahref.startsWith("../../../../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 4; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../../../../", hrefStr);
							a.attr("href",ahref);
						}else if(ahref.startsWith("../../../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 3; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../../../", hrefStr);
							a.attr("href",ahref);
						}else if(ahref.startsWith("../../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 2; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../../", hrefStr);
							a.attr("href",ahref);
						}else if(ahref.startsWith("../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 1; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../", hrefStr);
							a.attr("href",ahref);
						}else if(ahref.startsWith("//")){
							ahref = ahref.replace("//", "http://");
							a.attr("href",ahref);
						}else if(ahref.startsWith("/")){
							ahref = urlBefore + ahref ;
							a.attr("href",ahref);
						}else {
							if(!href.endsWith("html")) {
								ahref = href + ahref ;
								a.attr("href",ahref);
							}else {
								String hrefStr = "";
								String[] hrefStrs = href.split("/");
								for (int k = 0; k < hrefStrs.length - 1; k++) {
									hrefStr = hrefStr + hrefStrs[k]+"/";
								}
								ahref = hrefStr + ahref;
								a.attr("href",ahref);
							}
						}
					}else if(ahref.startsWith("http://www.csair.com/cn/tourguide")) {
						a.attr("data",ahref);
						a.attr("href","javascript:void(0)");
						a.attr("class","spearlLink");
					}
					String adata = a.attr("data");
					if(adata.contains("foodMenu.jsp?")) {
						ahref = adata;
						a.attr("href",ahref);
						a.attr("data","");
					}
				}
				Elements as4 = doc.select(".oldList a");
				for (int j = 0; j < as4.size(); j++) {
					Element a = as4.get(j);
					String ahref = a.attr("href");
					if(!ahref.startsWith("http") && !ahref.startsWith("javascript") && !ahref.startsWith("#") && !ahref.endsWith(".pdf") && !ahref.endsWith(".jpg") && !ahref.endsWith(".zip") && !ahref.endsWith(".png") && !ahref.endsWith(".xlsx") && !ahref.contains("login.html") && !ahref.equals("")) {
						if(ahref.startsWith("../../../../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 4; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../../../../", hrefStr);
							a.attr("data",ahref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}else if(ahref.startsWith("../../../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 3; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../../../", hrefStr);
							a.attr("data",ahref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}else if(ahref.startsWith("../../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 2; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../../", hrefStr);
							a.attr("data",ahref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}else if(ahref.startsWith("../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 1; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../", hrefStr);
							a.attr("data",ahref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}else if(ahref.startsWith("//")){
							ahref = ahref.replace("//", "http://");
							a.attr("data",ahref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}else if(ahref.startsWith("/")){
							ahref = urlBefore + ahref ;
							a.attr("data",ahref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}else {
							ahref = href + ahref ;
							a.attr("data",ahref);
							a.attr("href","javascript:void(0)");
							a.attr("class","spearlLink");
						}
					}else if(ahref.endsWith(".pdf") || ahref.contains("login.html") || ahref.endsWith(".jpg") || ahref.endsWith(".zip")|| ahref.endsWith(".png")|| ahref.endsWith(".xlsx")) {
						if(ahref.startsWith("../../../../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 4; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../../../../", hrefStr);
							a.attr("href",ahref);
						}else if(ahref.startsWith("../../../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 3; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../../../", hrefStr);
							a.attr("href",ahref);
						}else if(ahref.startsWith("../../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 2; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../../", hrefStr);
							a.attr("href",ahref);
						}else if(ahref.startsWith("../")) {
							String hrefStr = "";
							String[] hrefStrs = href.split("/");
							for (int k = 0; k < hrefStrs.length - 1; k++) {
								hrefStr = hrefStr + hrefStrs[k]+"/";
							}
							ahref = ahref.replace("../", hrefStr);
							a.attr("href",ahref);
						}else if(ahref.startsWith("//")){
							ahref = ahref.replace("//", "http://");
							a.attr("href",ahref);
						}else if(ahref.startsWith("/")){
							ahref = urlBefore + ahref ;
							a.attr("href",ahref);
						}else {
							if(!href.endsWith("html")) {
								ahref = href + ahref ;
								a.attr("href",ahref);
							}else {
								String hrefStr = "";
								String[] hrefStrs = href.split("/");
								for (int k = 0; k < hrefStrs.length - 1; k++) {
									hrefStr = hrefStr + hrefStrs[k]+"/";
								}
								ahref = hrefStr + ahref;
								a.attr("href",ahref);
							}
						}
					}
				}
				Elements imgs1 = doc.select(".form-con-list img");
				for (int j = 0; j < imgs1.size(); j++) {
					Element img = imgs1.get(j);
					String imgSrc = img.attr("src");
					if(!imgSrc.startsWith("http")) {
						if(imgSrc.startsWith("/")) {
							imgSrc = urlBefore + imgSrc ;
						}else {
							if(href.endsWith(".html")||href.endsWith(".shtml")) {
								String hrefStr = "";
								String[] hrefStrs = href.split("/");
								for (int k = 0; k < hrefStrs.length - 1; k++) {
									hrefStr = hrefStr + hrefStrs[k]+"/";
								}
								imgSrc = hrefStr + imgSrc ;
								System.out.println("111!!!!!!!!imgSrc====>"+imgSrc);
							}else {
								imgSrc = href + imgSrc ;
								System.out.println("2222!!!!!!!!imgSrc====>"+imgSrc);
							}
						}
						img.attr("src",imgSrc);
					}
				}
				
				Elements imgs2 = doc.select(".destination img");
				for (int j = 0; j < imgs2.size(); j++) {
					Element img = imgs2.get(j);
					String imgSrc = img.attr("src");
					if(!imgSrc.startsWith("http")) {
						if(imgSrc.startsWith("/")) {
							imgSrc = urlBefore + imgSrc ;
						}else {
							if(href.endsWith(".html")||href.endsWith(".shtml")) {
								String hrefStr = "";
								String[] hrefStrs = href.split("/");
								for (int k = 0; k < hrefStrs.length - 1; k++) {
									hrefStr = hrefStr + hrefStrs[k]+"/";
								}
								imgSrc = hrefStr + imgSrc ;
							}else {
								imgSrc = href + imgSrc ;
							}
						}
						img.attr("src",imgSrc);
					}
				}
				Elements imgs4 = doc.select(".oldList img");
				for (int j = 0; j < imgs4.size(); j++) {
					Element img = imgs4.get(j);
					String imgSrc = img.attr("src");
					if(!imgSrc.startsWith("http")) {
						if(imgSrc.startsWith("/")) {
							imgSrc = urlBefore + imgSrc ;
						}else {
							if(href.endsWith(".html")||href.endsWith(".shtml")) {
								String hrefStr = "";
								String[] hrefStrs = href.split("/");
								for (int k = 0; k < hrefStrs.length - 1; k++) {
									hrefStr = hrefStr + hrefStrs[k]+"/";
								}
								imgSrc = hrefStr + imgSrc ;
							}else {
								imgSrc = href + imgSrc ;
							}
						}
						img.attr("src",imgSrc);
					}
				}
				if(href.startsWith("http://www.csair.com/cn/tourguide/faq/")) {
					String hrefStr = "";
					String[] hrefStrs = href.split("/");
					for (int k = 0; k < hrefStrs.length - 1; k++) {
						hrefStr = hrefStr + hrefStrs[k]+"/";
					}
					Elements imgs3 = doc.select(".dc_left img");
					for (int j = 0; j < imgs3.size(); j++) {
						Element img = imgs3.get(j);
						String imgSrc = img.attr("src");
						if(!imgSrc.startsWith("http")) {
							imgSrc = hrefStr + imgSrc ;
							img.attr("src",imgSrc);
						}
					}
				}
				
				Elements embeds1 = doc.select(".form-con-list embed");
				for (int j = 0; j < embeds1.size(); j++) {
					Element embed = embeds1.get(j);
					String embedSrc = embed.attr("src");
					if(!embedSrc.startsWith("http")) {
						if(embedSrc.startsWith("/")) {
							embedSrc = urlBefore + embedSrc ;
						}else {
							if(href.endsWith(".html")||href.endsWith(".shtml")) {
								String hrefStr = "";
								String[] hrefStrs = href.split("/");
								for (int k = 0; k < hrefStrs.length - 1; k++) {
									hrefStr = hrefStr + hrefStrs[k]+"/";
								}
								embedSrc = hrefStr + embedSrc ;
							}else {
								embedSrc = href + embedSrc ;
							}
						}
						embed.attr("src",embedSrc);
					}
				}
				if( href.startsWith("http://www.csair.com/cn/contactus")) {
					map.put("title", "客服服务-联系我们");
				}else if(href.startsWith("http://www.csair.com/cn/tourguide")) {
					HtmlListItem more_list = (HtmlListItem) page.getBody().getElementsByAttribute("li", "class", "more-list").get(0);
					String title = more_list.getElementsByTagName("a").get(0).asText();
					map.put("title", title);
				}else if(href.startsWith("http://www.csair.com/cn/about")) {
					map.put("title", "关于南航");
				}
				map.put("Content", doc);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("点击链接进行内容加载........");
			}
		}
		return map;
	}


	/**
	 * 机票预订-各地服务点变更国家
	 */
	@Override
	public Map<String, Object> countryChange(String country) {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = lieBiaoContent.getHtmlPage();
		HtmlSelect countrySelect = (HtmlSelect) page.getElementById("country");
		HtmlOption option = countrySelect.getOptionByValue(country);
		option.setSelected(true);
		try {
			Thread.sleep(500);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		HtmlSelect citySelect = (HtmlSelect) page.getElementById("cname_city1");
		Document doc = Jsoup.parse(citySelect.asXml());
		Elements options = doc.select("option");
		map.put("Content", options);
		return map;
	}

	/**
	 * 机票预订-各地服务点搜索
	 */
	@Override
	public Map<String, Object> searchServicePoint(String country, String city) {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = lieBiaoContent.getHtmlPage();
		HtmlSelect countrySelect = (HtmlSelect) page.getElementById("country");
		HtmlOption countryOption = countrySelect.getOptionByValue(country);
		countryOption.setSelected(true);
		HtmlSelect citySelect = (HtmlSelect) page.getElementById("cname_city1");
		HtmlOption cityOption = citySelect.getOptionByValue(city);
		cityOption.setSelected(true);
		HtmlInput sumbitthis = (HtmlInput) page.getElementById("sumbitthis");
		clickHandler(sumbitthis);
		try {
			Thread.sleep(500);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		HtmlDivision resultDiv = (HtmlDivision) page.getElementById("result");
		Document doc = Jsoup.parse(resultDiv.asXml());
		String h2 = "";
		String table = "";
		String content = "";
		Elements tables = doc.select("table");
		if(tables.size() != 0) {
			h2 = doc.select("h2").get(0).toString();
			table = tables.get(0).toString();
			content = h2 + table;
		}
		map.put("Content", content);
		return map;
	}

	/**
	 * 机票预订-南航授权代理商搜索
	 */
	@Override
	public Map<String, Object> searchAgent(String cityValue, String selValue, String selectValue) {
		scl.searchAgent = null;
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = lieBiaoContent.getHtmlPage();
		HtmlInput cityInput = (HtmlInput) page.getElementById("cname_city7");
		cityInput.setValueAttribute(cityValue);
		HtmlInput selValueInput = (HtmlInput) page.getElementById("selvalue");
		selValueInput.setValueAttribute(selValue);
		HtmlSelect selSelect = (HtmlSelect) page.getElementById("sel");
		HtmlOption option = selSelect.getOptionByValue(selectValue);
		option.setSelected(true);
		HtmlInput sumbittoInput = (HtmlInput) page.getElementById("sumbitto");
		clickHandler(sumbittoInput);
		for (int i = 0; i < timeoutmax; i++) {
			if(scl.searchAgent != null) {
				HtmlDivision resultDiv = (HtmlDivision) page.getElementById("result");
				Document doc = Jsoup.parse(resultDiv.asXml());
				String h2 = "";
				String table = "";
				String content = "";
				Elements tables = doc.select("table");
				if(tables.size() != 0) {
					h2 = doc.select("h2").get(0).toString();
					table = tables.get(0).toString();
					content = h2 + table;
				}
				if(content.trim().equals("")) {
					content = doc.text();
				}
				map.put("Content",content);
				break;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("搜索代理商.....");
			}
		}
		return map;
	}

	/**
	 * 机场服务-电子商务柜台城市变更
	 */
	@Override
	public Map<String, Object> airportServiceCityChange(String city) {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = lieBiaoContent.getHtmlPage();
		HtmlSelect citySelect = (HtmlSelect) page.getElementById("city_options");
		HtmlOption option = citySelect.getOptionByValue(city);
		option.setSelected(true);
		HtmlDivision current_city = (HtmlDivision) page.getElementById("current_city");
		HtmlTable city_list = (HtmlTable) page.getElementById("city_list");
		String current_cityText = current_city.asText();
		map.put("current_city", current_cityText);
		String city_listAsxml = city_list.asXml();
		map.put("city_list", city_listAsxml);
		return map;
	}

	/**
	 * 客户服务-用户反馈页面加载
	 */
	@Override
	public Map<String, Object> loadUserFeedback() {
		Map<String, Object> map = new HashMap<String , Object>();
		userFeedbackPage = webClient.getCsairHtmlPage(Csair.userFeedbackPage, "userFeedbackPage", false);
		HtmlPage page = userFeedbackPage.getHtmlPage();
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision ticketSellDiv = (HtmlDivision) page.getElementById("ticketSell");
			if(ticketSellDiv != null) {
				map.put("notice", "true");
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载用户反馈页面.......");
			}
		}
		map.put("notice", "false");
		return map;
	}


	/**
	 * 客户服务-用户反馈页面验证码发送
	 */
	@Override
	public Map<String, Object> userFeedback_yzm(String mobile) {
		Map<String, Object> map = new HashMap<String , Object>();
		HtmlPage page = userFeedbackPage.getHtmlPage();
		HtmlInput mobileInput = (HtmlInput) page.getElementById("mobile");
		mobileInput.setValueAttribute(mobile);
		HtmlSpan forMcodeSpan = (HtmlSpan) page.getElementById("forMcode");
		if(forMcodeSpan != null) {
			clickHandler(forMcodeSpan);
		}
		
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision popupBoxDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "popupBox").get(0);
			String popupBoxDivStyle = popupBoxDiv.getAttribute("style");
			log.info("popupBoxDivStyle======>"+popupBoxDivStyle);
			if(!popupBoxDivStyle.contains("none")) {
				HtmlDivision popupContentDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "popupContent").get(0);
				String popupContentDivText = popupContentDiv.asText();
				map.put("msg", popupContentDivText);
				HtmlDivision popupButtonDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "popupButton").get(0);
				clickHandler(popupButtonDiv);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("发送验证码,等待返回信息......");
			}
		}
		map.put("msg", "发送失败");
		return map;
	}

	/**
	 * 客户服务-用户反馈页面提交反馈
	 */
	@Override
	public Map<String, Object> userFeedback_submit(UserFeedback userFeedback) {
		Map<String, Object> map = new HashMap<String , Object>();
		HtmlPage page = userFeedbackPage.getHtmlPage();
		HtmlDivision boxContent1 = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "boxContent").get(1);
		HtmlDivision boxContent1_item0 = (HtmlDivision) boxContent1.getElementsByAttribute("div", "class", "item").get(0);
		List<HtmlElement> boxContent1_item0_chooseBoxes = boxContent1_item0.getElementsByAttribute("div", "class", "chooseBox");
		for (int i = 0; i < boxContent1_item0_chooseBoxes.size(); i++) {
			HtmlDivision boxContent1_item0_chooseBox = (HtmlDivision) boxContent1_item0_chooseBoxes.get(i);
			String boxContent1_item0_chooseBoxDataValue = boxContent1_item0_chooseBox.getAttribute("data-val");
			if(userFeedback.getCategory().equals(boxContent1_item0_chooseBoxDataValue)) {
				clickHandler(boxContent1_item0_chooseBox);
			}
		}
		
		HtmlDivision boxContent1_item1 = (HtmlDivision) boxContent1.getElementsByAttribute("div", "class", "item").get(1);
		List<HtmlElement> boxContent1_item1_chooseBoxes = boxContent1_item1.getElementsByAttribute("div", "class", "chooseBox");
		for (int i = 0; i < boxContent1_item1_chooseBoxes.size(); i++) {
			HtmlDivision boxContent1_item1_chooseBox = (HtmlDivision) boxContent1_item1_chooseBoxes.get(i);
			String boxContent1_item1_chooseBoxDataValue = boxContent1_item1_chooseBox.getAttribute("data-val");
			if(userFeedback.getBusinessType().equals(boxContent1_item1_chooseBoxDataValue)) {
				clickHandler(boxContent1_item1_chooseBox);
			}
		}
		
		HtmlDivision boxContent1_item2 = (HtmlDivision) boxContent1.getElementsByAttribute("div", "class", "item").get(2);
		List<HtmlElement> boxContent1_item2_chooseBoxes = boxContent1_item2.getElementsByAttribute("div", "class", "chooseBox");
		for (int i = 0; i < boxContent1_item2_chooseBoxes.size(); i++) {
			HtmlDivision boxContent1_item2_chooseBox = (HtmlDivision) boxContent1_item2_chooseBoxes.get(i);
			String boxContent1_item2_chooseBoxDataValue = boxContent1_item2_chooseBox.getAttribute("data-val");
			if(userFeedback.getHandChannel().equals(boxContent1_item2_chooseBoxDataValue)) {
				clickHandler(boxContent1_item2_chooseBox);
			}
		}
		
		HtmlInput nameInput = (HtmlInput) page.getElementById("name");
		nameInput.setValueAttribute(userFeedback.getName());
		HtmlTextArea contentTextarea = (HtmlTextArea) page.getElementById("content");
		contentTextarea.setTextContent(userFeedback.getContent());
		HtmlInput usernameInput = (HtmlInput) page.getElementById("username");
		usernameInput.setValueAttribute(userFeedback.getUsername());
		HtmlInput mobileInput = (HtmlInput) page.getElementById("mobile");
		mobileInput.setValueAttribute(userFeedback.getMobile());
		HtmlInput mcodeInput = (HtmlInput) page.getElementById("mcode");
		mcodeInput.setValueAttribute(userFeedback.getMcode());
		HtmlInput emailInput = (HtmlInput) page.getElementById("email");
		emailInput.setValueAttribute(userFeedback.getEmail());
		HtmlInput formSubmitInput = (HtmlInput) page.getElementById("formSubmit");
		clickHandler(formSubmitInput);
		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision popupBoxDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "popupBox").get(0);
			String popupBoxDivStyle = popupBoxDiv.getAttribute("style");
			log.info("popupBoxDivStyle======>"+popupBoxDivStyle);
			if(!popupBoxDivStyle.contains("none")) {
				HtmlDivision popupContentDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "popupContent").get(0);
				String popupContentDivText = popupContentDiv.asText();
				map.put("msg", popupContentDivText);
				HtmlDivision popupButtonDiv = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "popupButton").get(0);
				clickHandler(popupButtonDiv);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("提交反馈,等待返回信息......");
			}
		}
		map.put("msg", "反馈意见提交超时！");
		return map;
	}

	/**
	 * 关于南航-投资者关系-列表页号选择
	 */
	@Override
	public Map<String, Object> csairPagesClick(String href,String pageCount) {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = lieBiaoContent.getHtmlPage();
		HtmlDivision pagesDiv = (HtmlDivision) page.getElementById("pagesDiv");
		DomNodeList<HtmlElement> as = pagesDiv.getElementsByTagName("a");
		for (int i = 0; i < as.size(); i++) {
			HtmlElement a = as.get(i);
			String a_pageCount = a.asText().trim();
			if(pageCount.equals(a_pageCount)) {
				clickHandler(a);
				break;
			}
		}
	
		List<HtmlElement> second_rightDivs = page.getBody().getElementsByAttribute("div", "class", "second-right");
		if(second_rightDivs.size() != 0) {
			String urlBefore = "http://www.csair.com";
			HtmlDivision second_rightDiv = (HtmlDivision) second_rightDivs.get(0);
			Document doc = Jsoup.parse(second_rightDiv.asXml());
			doc.select(".current-align").remove();
			doc.select("style").remove();
			doc.select("script").remove();
			doc.select("#dc_sharebar").remove();
			doc.select(".mainbr").remove();
			
			Elements as4 = doc.select(".oldList a");
		for (int j = 0; j < as4.size(); j++) {
			Element a = as4.get(j);
			String ahref = a.attr("href");
			if(!ahref.startsWith("http") && !ahref.startsWith("#") && !ahref.endsWith(".pdf") && !ahref.endsWith(".jpg") && !ahref.endsWith(".zip") && !ahref.endsWith(".png") && !ahref.endsWith(".xlsx") && !ahref.contains("login.html") && !ahref.equals("")) {
				if(ahref.startsWith("../../../../")) {
					String hrefStr = "";
					String[] hrefStrs = href.split("/");
					for (int k = 0; k < hrefStrs.length - 4; k++) {
						hrefStr = hrefStr + hrefStrs[k]+"/";
					}
					ahref = ahref.replace("../../../../", hrefStr);
					a.attr("data",ahref);
					a.attr("href","javascript:void(0)");
					a.attr("class","spearlLink");
				}else if(ahref.startsWith("../../../")) {
					String hrefStr = "";
					String[] hrefStrs = href.split("/");
					for (int k = 0; k < hrefStrs.length - 3; k++) {
						hrefStr = hrefStr + hrefStrs[k]+"/";
					}
					ahref = ahref.replace("../../../", hrefStr);
					a.attr("data",ahref);
					a.attr("href","javascript:void(0)");
					a.attr("class","spearlLink");
				}else if(ahref.startsWith("../../")) {
					String hrefStr = "";
					String[] hrefStrs = href.split("/");
					for (int k = 0; k < hrefStrs.length - 2; k++) {
						hrefStr = hrefStr + hrefStrs[k]+"/";
					}
					ahref = ahref.replace("../../", hrefStr);
					a.attr("data",ahref);
					a.attr("href","javascript:void(0)");
					a.attr("class","spearlLink");
				}else if(ahref.startsWith("../")) {
					String hrefStr = "";
					String[] hrefStrs = href.split("/");
					for (int k = 0; k < hrefStrs.length - 1; k++) {
						hrefStr = hrefStr + hrefStrs[k]+"/";
					}
					ahref = ahref.replace("../", hrefStr);
					a.attr("data",ahref);
					a.attr("href","javascript:void(0)");
					a.attr("class","spearlLink");
				}else if(ahref.startsWith("//")){
					ahref = ahref.replace("//", "http://");
					a.attr("data",ahref);
					a.attr("href","javascript:void(0)");
					a.attr("class","spearlLink");
				}else if(ahref.startsWith("/")){
					ahref = urlBefore + ahref ;
					a.attr("data",ahref);
					a.attr("href","javascript:void(0)");
					a.attr("class","spearlLink");
				}else {
					ahref = href + ahref ;
					a.attr("data",ahref);
					a.attr("href","javascript:void(0)");
					a.attr("class","spearlLink");
				}
			}else if(ahref.endsWith(".pdf") || ahref.contains("login.html") || ahref.endsWith(".jpg") || ahref.endsWith(".zip")|| ahref.endsWith(".png")|| ahref.endsWith(".xlsx")) {
				if(ahref.startsWith("../../../../")) {
					String hrefStr = "";
					String[] hrefStrs = href.split("/");
					for (int k = 0; k < hrefStrs.length - 4; k++) {
						hrefStr = hrefStr + hrefStrs[k]+"/";
					}
					ahref = ahref.replace("../../../../", hrefStr);
					a.attr("href",ahref);
				}else if(ahref.startsWith("../../../")) {
					String hrefStr = "";
					String[] hrefStrs = href.split("/");
					for (int k = 0; k < hrefStrs.length - 3; k++) {
						hrefStr = hrefStr + hrefStrs[k]+"/";
					}
					ahref = ahref.replace("../../../", hrefStr);
					a.attr("href",ahref);
				}else if(ahref.startsWith("../../")) {
					String hrefStr = "";
					String[] hrefStrs = href.split("/");
					for (int k = 0; k < hrefStrs.length - 2; k++) {
						hrefStr = hrefStr + hrefStrs[k]+"/";
					}
					ahref = ahref.replace("../../", hrefStr);
					a.attr("href",ahref);
				}else if(ahref.startsWith("../")) {
					String hrefStr = "";
					String[] hrefStrs = href.split("/");
					for (int k = 0; k < hrefStrs.length - 1; k++) {
						hrefStr = hrefStr + hrefStrs[k]+"/";
					}
					ahref = ahref.replace("../", hrefStr);
					a.attr("href",ahref);
				}else if(ahref.startsWith("//")){
					ahref = ahref.replace("//", "http://");
					a.attr("href",ahref);
				}else if(ahref.startsWith("/")){
					ahref = urlBefore + ahref ;
					a.attr("href",ahref);
				}else {
					if(!href.endsWith("html")) {
						ahref = href + ahref ;
						a.attr("href",ahref);
					}else {
						String hrefStr = "";
						String[] hrefStrs = href.split("/");
						for (int k = 0; k < hrefStrs.length - 1; k++) {
							hrefStr = hrefStr + hrefStrs[k]+"/";
						}
						ahref = hrefStr + ahref;
						a.attr("href",ahref);
					}
				}
			}
		}
		map.put("Content", doc);
		return map;
	}
		return map;
	}


	/**
	 * 关于南航-投资者关系-电邮订阅中心提交
	 */
	@Override
	public Map<String, Object> submitEmail(String emailNo, String m_status, String firstName, String lastName,
			String vocation, String country) {
		alertMessage = null;
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = lieBiaoContent.getHtmlPage();
		HtmlInput checkboxInput = (HtmlInput) page.getElementById("d2c770dad0bd420483c424820300243b");
		clickHandler(checkboxInput);
		HtmlInput emailNoInput = (HtmlInput) page.getElementById("emailNo");
		emailNoInput.setValueAttribute(emailNo);
		HtmlSelect m_statusSelect = (HtmlSelect) page.getElementById("m-status");
		HtmlOption option1 = m_statusSelect.getOptionByValue(m_status);
		option1.setSelected(true);
		HtmlInput firstNameInput = (HtmlInput) page.getElementById("firstName");
		firstNameInput.setValueAttribute(firstName);
		HtmlInput lastNameInput = (HtmlInput) page.getElementById("lastName");
		lastNameInput.setValueAttribute(lastName);
		HtmlSelect vocationSelect = (HtmlSelect) page.getElementById("vocation");
		HtmlOption option2 = vocationSelect.getOptionByValue(vocation);
		option2.setSelected(true);
		HtmlSelect countrySelect = (HtmlSelect) page.getElementById("country");
		HtmlOption option3 = countrySelect.getOptionByValue(country);
		option3.setSelected(true);
		HtmlInput emailSubmitInput = (HtmlInput) page.getElementById("email-submit");
		clickHandler(emailSubmitInput);
		for (int i = 0; i < timeoutmax; i++) {
			if(alertMessage != null) {
				map.put("notice", alertMessage);
				return map;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("等待页面反馈信息.......");
			}
		}
		map.put("notice", "提交失败！");
		return map;
	}

	/**
	 * 关于南航-投资者关系-财务总览表格选择
	 */
	@Override
	public Map<String, Object> tableChooseClick(String data_href) {
		log.info("data_href=====>"+data_href);
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = lieBiaoContent.getHtmlPage();
		HtmlDivision finDiv = (HtmlDivision) page.getElementById("fin");
		DomNodeList<HtmlElement> lis = finDiv.getElementsByTagName("li");
		for (int i = 0; i < lis.size(); i++) {
			HtmlElement li = lis.get(i);
			String li_data_href = li.getAttribute("data-href");
			log.info("li_data_href=====>"+li_data_href);
			if(data_href.equals(li_data_href)) {
				clickHandler(li);
				break;
			}
		}
		try {
			Thread.sleep(500);
		} catch (InterruptedException e1) {
			e1.printStackTrace();
		}
		List<HtmlElement> second_rightDivs = page.getBody().getElementsByAttribute("div", "class", "second-right");
		HtmlDivision second_rightDiv = (HtmlDivision) second_rightDivs.get(0);
		Document doc = Jsoup.parse(second_rightDiv.asXml());
		doc.select(".current-align").remove();
		doc.select(".search-checkbox").remove();
		doc.select("object").remove();
		doc.select(".IAT-Buttons").remove();

		for (int j = 0; j < timeoutmax; j++) {
			HtmlTable tb = (HtmlTable) page.getElementById("tb");
			DomNodeList<HtmlElement> tds = tb.getElementsByTagName("td");
			if(tds.size() != 0) {
				doc.select("#container").remove();
				doc.select("#cb").remove();
				doc.select("input[type=checkbox]").remove();
				Elements as = doc.select(".nav-tabs  a");
				for (int j1 = 0; j1 < as.size(); j1++) {
					Element a = as.get(j1);
					String ahref = a.attr("href");
					ahref = "http://skypearl.csair.com/cn/" + ahref ;
					a.attr("data",ahref);
					a.attr("href","javascript:void(0)");
					a.attr("class","spearlLink");
				}
				Elements li2s = doc.select("#fin li");
				for (int i = 0; i < li2s.size(); i++) {
					Element li2 = li2s.get(i);
					String li2Text = li2.text();
					li2.html("<a href='javascript:void(0)'>"+li2Text+"</a>");
				}
				break;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载表格.......");
			}
		}
		map.put("Content", doc);
		return map;
	}


	/**
	 * 加载全站搜索
	 */
	@Override
	public Map<String, Object> loadCsairSearch(String href) {
		CsairSearchPage = null;
		Map<String, Object> map = new HashMap<String,Object>();
		CsairSearchPage = webClient.getCsairHtmlPage(href, "CsairSearchPage", false);
		HtmlPage page = CsairSearchPage.getHtmlPage();
		
		for (int i = 0; i < timeoutmax; i++) {
			List<HtmlElement> left_zysDivs = page.getBody().getElementsByAttribute("div", "class", "left_zys");
			if(left_zysDivs.size() != 0) {
//				HtmlDivision left_zysDiv = (HtmlDivision) left_zysDivs.get(0);
//				
//				Document doc = Jsoup.parse(left_zysDiv.asXml());
//				doc.select(".submit_zys").attr("type", "button");
//				Elements as1 = doc.select(".main_zys  .list_zys  a");
//				for (int j = 0; j < as1.size(); j++) {
//					Element a = as1.get(j);
//					String ahref = a.attr("href");
//					if(!ahref.endsWith(".pdf") && !ahref.endsWith(".jpg") && !ahref.endsWith(".zip") && !ahref.endsWith(".png")&& !ahref.endsWith(".xlsx")) {
//						if(ahref.startsWith("http://www.csair.com/cn/about") || ahref.startsWith("http://www.csair.com/cn/tourguide")) {
//							a.attr("data",ahref);
//							a.attr("href","javascript:void(0)");
//							a.attr("class","spearlLink");
//						}
//					}
//				}
//				Elements as2 = doc.select("#pagesDiv a");
//				for (int j = 0; j < as2.size(); j++) {
//					Element a = as2.get(j);
//					a.attr("href","javascript:void(0)");
//				}
//				Elements spans = doc.select("#pagesDiv span");
//				if(spans.size() != 0) {
//					Element span = spans.get(0);
//					String spanText = span.text();
//					span.html("<a href='javascript:void(0);'"+spanText+"</a>");
//				}
//				log.info(doc.toString());
//				
//				map.put("Content", doc);
				map.put("notice", "true");
				return map;
			}
			
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("加载页面......");
			}
		}
		map.put("notice", "false");
		return map;
	}

	/**
	 * 全站搜索提交
	 */
	@Override
	public Map<String, Object> csairSearchAll(String keyWord) {
		scl.CsairSearchPage = null;
		Map<String, Object> map = new HashMap<String,Object>();
		HtmlPage page = CsairSearchPage.getHtmlPage();
		HtmlInput text_zys = (HtmlInput) page.getBody().getElementsByAttribute("input", "class", "text_zys ui-autocomplete-input").get(0);
		text_zys.setValueAttribute(keyWord);
		HtmlInput submit_zys = (HtmlInput) page.getBody().getElementsByAttribute("input", "class", "submit_zys").get(0);
		clickHandler(submit_zys);
		for (int i = 0; i < timeoutmax; i++) {
			if(scl.CsairSearchPage != null) {
				CsairSearchPage = webClient.getCsairHtmlPage(scl.CsairSearchPage, "CsairSearchPage", false);
				page = CsairSearchPage.getHtmlPage();
				for (int j = 0; j < timeoutmax; j++) {
					List<HtmlElement> left_zysDivs = page.getBody().getElementsByAttribute("div", "class", "left_zys");
					if(left_zysDivs.size() != 0) {
						HtmlDivision left_zysDiv = (HtmlDivision) left_zysDivs.get(0);
						
						Document doc = Jsoup.parse(left_zysDiv.asXml());
						doc.select("form").removeAttr("action");
						doc.select(".submit_zys").attr("type", "button");
						Elements as1 = doc.select(".main_zys  .list_zys  a");
						for (int j1 = 0; j1 < as1.size(); j1++) {
							Element a = as1.get(j1);
							String ahref = a.attr("href");
							if(!ahref.endsWith(".pdf") && !ahref.endsWith(".jpg") && !ahref.endsWith(".zip") && !ahref.endsWith(".png")&& !ahref.endsWith(".xlsx")) {
								if(ahref.startsWith("http://www.csair.com/cn/about") || ahref.startsWith("http://www.csair.com/cn/tourguide")) {
									a.attr("data",ahref);
									a.attr("href","javascript:void(0)");
									a.attr("class","spearlLink");
								}
							}
						}
						Elements as2 = doc.select("#pagesDiv a");
						for (int j1 = 0; j1 < as2.size(); j1++) {
							Element a = as2.get(j1);
							a.attr("href","javascript:void(0)");
						}
						Elements spans = doc.select("#pagesDiv span");
						if(spans.size() != 0) {
							Element span = spans.get(0);
							String spanText = span.text();
							span.html("<a href='javascript:void(0);'>"+spanText+"</a>");
						}
						
						String main_zys = doc.select(".main_zys").toString();
						String page_zys = doc.select(".page_zys").toString();
						map.put("main_zys", main_zys);
						map.put("page_zys", page_zys);
						map.put("notice", "true");
						return map;
					}
					
					synchronized (page) {
						try {
							page.wait(500);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						log.info("加载页面......");
					}
				}
				break;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("等待链接返回......");
			}
		}
		map.put("notice", "false");
		return map;
	}

	/**
	 * 全站搜索页数点击
	 */
	@Override
	public Map<String, Object> searchPageClick(String pageCount) {
		log.info("pageCount====>"+pageCount);
		scl.CsairSearchPage = null;
		Map<String, Object> map = new HashMap<String,Object>();
		HtmlPage page = CsairSearchPage.getHtmlPage();
		HtmlDivision pagesDiv = (HtmlDivision) page.getElementById("pagesDiv");
		DomNodeList<HtmlElement> page_as = pagesDiv.getElementsByTagName("a");
		for (int i = 0; i < page_as.size(); i++) {
			HtmlAnchor page_a = (HtmlAnchor) page_as.get(i);
			String a_pageCount = page_a.asText();
			log.info("a_pageCount=======>"+a_pageCount);
			if(pageCount.equals(a_pageCount)) {
				log.info("come on!!!!!!!!!!!!!!!!!!!!!");
				clickHandler(page_a);
				break;
			}
		}

		for (int i = 0; i < timeoutmax; i++) {
			if(scl.CsairSearchPage != null) {
				CsairSearchPage = webClient.getCsairHtmlPage(scl.CsairSearchPage, "CsairSearchPage", false);
				page = CsairSearchPage.getHtmlPage();
				for (int j = 0; j < timeoutmax; j++) {
					List<HtmlElement> left_zysDivs = page.getBody().getElementsByAttribute("div", "class", "left_zys");
					if(left_zysDivs.size() != 0) {
						HtmlDivision left_zysDiv = (HtmlDivision) left_zysDivs.get(0);
						
						Document doc = Jsoup.parse(left_zysDiv.asXml());
						doc.select("form").removeAttr("action");
						doc.select(".submit_zys").attr("type", "button");
						Elements as1 = doc.select(".main_zys  .list_zys  a");
						for (int j1 = 0; j1 < as1.size(); j1++) {
							Element a = as1.get(j1);
							String ahref = a.attr("href");
							if(!ahref.endsWith(".pdf") && !ahref.endsWith(".jpg") && !ahref.endsWith(".zip") && !ahref.endsWith(".png")&& !ahref.endsWith(".xlsx")) {
								if(ahref.startsWith("http://www.csair.com/cn/about") || ahref.startsWith("http://www.csair.com/cn/tourguide")) {
									a.attr("data",ahref);
									a.attr("href","javascript:void(0)");
									a.attr("class","spearlLink");
								}
							}
						}
						Elements as2 = doc.select("#pagesDiv a");
						for (int j1 = 0; j1 < as2.size(); j1++) {
							Element a = as2.get(j1);
							a.attr("href","javascript:void(0)");
						}
						Elements spans = doc.select("#pagesDiv span");
						if(spans.size() != 0) {
							Element span = spans.get(0);
							String spanText = span.text();
							span.html("<a href='javascript:void(0);'>"+spanText+"</a>");
						}
						
						String main_zys = doc.select(".main_zys").toString();
						String page_zys = doc.select(".page_zys").toString();
						map.put("main_zys", main_zys);
						map.put("page_zys", page_zys);
						map.put("notice", "true");
						return map;
					}
					
					synchronized (page) {
						try {
							page.wait(500);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						log.info("加载页面......");
					}
				}
				break;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("等待链接返回.....");
			}
		}
		map.put("notice", "false");
		return map;
	}

	/**
	 * 国际单程航班查询
	 */
	@Override
	public Map<String, Object> internationalFlightQuery(String c1, String c2, String date, int number1, int number2,
			int number3, int year, int month, int day, int year2, int month2, int day2) {
		Map<String, Object> map = new HashMap<String, Object>();
		List<FlightInternational> flights = new ArrayList<FlightInternational>();
		URLinternationalflightQuery = "https://b2c.csair.com/ita/intl/zh/flights?flex=1&m=0&p="+number1+number2+number3+"&t="+c1+"-"+c2+"-"+date+"&egs=ITA,ITA";
//		URLinternationalflightQuery = "https://b2c.csair.com/B2C40/modules/bookingnew/inter/flightSelectDirect.html?t=S&c1=PEK&c2=PAR&d1=2019-06-25&at=1&ct=0&it=0&egs=IBE";
		
		log.info("URLinternationalflightQuery====>"+URLinternationalflightQuery);
		internationalFlightQuery = webClient.getCsairHtmlPage(URLinternationalflightQuery, "URLinternationalflightQuery", false);
		HtmlPage page = internationalFlightQuery.getHtmlPage();
		
		for (int i = 0; i <timeoutmax; i++) {
			//未查询到航班提示
			HtmlDivision alert_error = page.getFirstByXPath("//div[@class='error-info']");
			if (alert_error != null) {
				map.put("cf", c1);
				map.put("dd", c2);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				HtmlDivision qc = page.getFirstByXPath("//div[@class='cities']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='date']");
				
				map.put("qc", qc.asText());// 全程
				map.put("rq", rq.asText());// 日期

				HtmlDivision lk = page.getFirstByXPath("//div[@class='psgs']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span");
				String adult = lkelments.get(0).text();
				String child = lkelments.get(1).text();
				String baby = lkelments.get(2).text();
				map.put("adult", adult);
				map.put("child", child);
				map.put("baby", baby);
				
				if(alert_error != null){
					map.put("noflight", alert_error.asText());
				}
				return map;
			}
			
			//页面的可能展示样式1
			HtmlDivision sh_trip_itemDiv = (HtmlDivision) page.getElementById("sh-trip-item-0-0");
			if(sh_trip_itemDiv != null) {
				map.put("cf", c1);
				map.put("dd", c2);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				HtmlDivision qc = page.getFirstByXPath("//div[@class='cities']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='date']");
				
				map.put("qc", qc.asText());// 全程
				map.put("rq", rq.asText());// 日期

				HtmlDivision lk = page.getFirstByXPath("//div[@class='psgs']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span");
				String adult = lkelments.get(0).text();
				String child = lkelments.get(1).text();
				String baby = lkelments.get(2).text();
				map.put("adult", adult);
				map.put("child", child);
				map.put("baby", baby);
				
				ArrayList<Cab> list = new ArrayList<Cab>();
				HtmlDivision cabinTab = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "sh-cabin-tab").get(0);
				DomNodeList<HtmlElement> cabinTabLis = cabinTab.getElementsByTagName("li");
				for (int j = 0; j < cabinTabLis.size(); j++) {
					Cab cab = new Cab();
					HtmlListItem cabinTabLi = (HtmlListItem) cabinTabLis.get(j);
					HtmlAnchor cabinTabLiA = (HtmlAnchor) cabinTabLi.getElementsByTagName("a").get(0);
					String cabinTabLiAHref = cabinTabLiA.getAttribute("href");
					String cabinTabLiACab = cabinTabLiA.asText();
					cab.setHref(cabinTabLiAHref);
					cab.setCab(cabinTabLiACab);
					list.add(cab);
				}
				map.put("list", list);
				
				HtmlDivision div = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "sh-list-view z-cab-ctt-0").get(0);
				Document document = Jsoup.parse(div.asXml());
				Elements elements = document.select("div.item");
				
				for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
					Element element = (Element) iterator.next();
					FlightInternational fi = new FlightInternational();
					
					// 起飞时间
					fi.qf_time = element.select("div.sh-intro li strong").get(0).text().trim();
					// 起飞城市
					fi.qf_city = element.select("div.sh-intro li strong").get(0).parent().ownText().trim();
					// 到达时间
					fi.dd_time = element.select("div.sh-intro li strong").get(1).text().trim();
					// 到达城市
					fi.dd_city = element.select("div.sh-intro li strong").get(1).parent().ownText().trim();
					// 航班号
					fi.hbh = element.select("div.caption").get(0).text().trim();
					// 飞机型号
//					f.jx = element.select("div.sp-trip-duration").get(0).text().trim();
					
					Element item1 = element.select("div.sh-cabins").get(0);
					if (item1 != null) {
						Element doc = item1;
						Elements els = doc.select("div.cab-0  span.sh-cab-name");
						if (!els.isEmpty()) {
							fi.cw = els.get(0).html();
						}
					}

					Elements item2s = element.select(".cab-0  div.price");
					if(item2s.size() != 0) {
						Element item2 = item2s.get(0);
						if (item2 != null) {
							Element doc = item2;
							Elements els = doc.select("strong");
							if (!els.isEmpty()) {
								fi.price = els.get(0).text().trim();
								System.out.println("fi.price====>"+fi.price);
							}
							fi.shouqing = "0";
						}
					}else {
						fi.shouqing = "1";
					}

					Element item3 = element.select("div.sh-cabins  a.j-choose").get(0);
					if (item3 != null) {
						fi.yd_id = item3.attr("id").trim();
					}
					
					Element item4 = element.select("a.j-detail").get(0);
					if (item4 != null) {
						fi.xq_href = item4.attr("href");
					}
					flights.add(fi);
				}
				map.put("flights", flights);
				map.put("mark", "1");
				
				for (int j = 0; j <= timeoutmax; j++) {
					HtmlDivision rls = page.getFirstByXPath("//div[@class='date-bar']");
					List<Kalendar> kalendars = new ArrayList<Kalendar>();
					if (rls != null) {
						Document document1 = Jsoup.parse(rls.asXml());
						Elements elements1 = document1.select("ul li");
						for (Iterator<Element> iterator = elements1.iterator(); iterator.hasNext();) {
							Element li = (Element) iterator.next();
							Kalendar k = new Kalendar();
							k.id = li.attr("data-date").trim();
//							log.info("cls:" + k.id);
							String cls = li.attr("class");
							if (cls != null && cls.trim().contains("current")) {
								k.current = "current";
							}
							k.week = li.select("div.cell  strong").get(0).ownText();
							k.date = li.select("div.cell").get(0).ownText();
							k.price = li.select("div.chart  b").get(0).ownText();
//							log.info(k);
							kalendars.add(k);
						}
						map.put("kalendars", kalendars);
						break;
					}
					synchronized (page) {
						try {
							page.wait(waittime);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
					}
				}
				return map;
			}
			
			//页面可能展示的样式2
			List<HtmlElement> sp_sol_overviews = page.getBody().getElementsByAttribute("div", "class", "sp-sol-overview");
			if(sp_sol_overviews.size() != 0) {
				map.put("cf", c1);
				map.put("dd", c2);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);
				map.put("week", "none");

				String qc = page.getBody().getElementsByAttribute("h3", "class", "sp-trip-title").get(0).asText();
				qc = qc.substring(0, qc.indexOf("20")-1);
				HtmlDivision rq = page.getFirstByXPath("//div[@class='sp-trip-dates line-1']");
				
				map.put("qc", qc);// 全程
				map.put("rq", rq.asText());// 日期

				List<HtmlElement> lkelments = page.getBody().getElementsByAttribute("span", "class", "sp-trip-psg");
				String adult = lkelments.get(0).asText();
				String child = lkelments.get(1).asText();
				String baby = lkelments.get(2).asText();
				map.put("adult", adult);
				map.put("child", child);
				map.put("baby", baby);
				
				HtmlDivision div = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "sp-result").get(0);
				Document document = Jsoup.parse(div.asXml());
				Elements elements = document.select("div.sp-solution");
				for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
					Element element = (Element) iterator.next();
					FlightInternational fi = new FlightInternational();
					
					// 起飞时间
					fi.qf_time = element.select("div.dep strong").get(0).text().trim();
					// 起飞城市
					fi.qf_city = element.select("div.dep").get(0).ownText().trim();
					// 到达时间
					fi.dd_time = element.select("div.arr strong").get(0).text().trim();
					// 到达城市
					fi.dd_city = element.select("div.arr").get(0).ownText().trim();
					// 航班号
					fi.hbh = element.select("div.sp-sol-slice-flight").get(0).text().trim();
					// 飞机型号
//					f.jx = element.select("div.sp-trip-duration").get(0).text().trim();
					
					Element item1 = element.select("ul.sp-sol-cell").get(0);
					if (item1 != null) {
						Element doc = item1;
						Elements els = doc.select("div.sp-sol-cell-slice");
						if (!els.isEmpty()) {
							fi.cw = els.get(0).html();
						}
					}

					Element item2 = element.select("li.price").get(0);
					if (item2 != null) {
						Element doc = item2;
						Elements els = doc.select("strong");
						if (!els.isEmpty()) {
							fi.price = els.get(0).text().trim();
							fi.shouqing = "0";
						}
					}

					Element item3 = element.select("a.j-sol-book").get(0);
					if (item3 != null) {
						fi.yd_href = item3.attr("href");
					}
					
					Element item4 = element.select("a.sp-sol-expander").get(0);
					if (item4 != null) {
						fi.xq_href = item4.attr("href");
					}
					flights.add(fi);
				}
				map.put("flights", flights);
				map.put("mark", "2");
				return map;
			}
			
			
			synchronized (page) {
				try {
					page.wait(2000);
					log.info("加载国际航班查询页......");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		System.out.println("加载超时！~~~~~~~~~~~");
		System.out.println(page.asXml());
		return null;
	}
	
	/**
	 * 国际航班查询WF
	 */
	@Override
	public Map<String, Object> internationalFlightQuery2(String c1, String c2, String date, String date2, int number1,
			int number2, int number3, int year, int month, int day, int year2, int month2, int day2) {
		Map<String, Object> map = new HashMap<String, Object>();
		List<FlightInternational> flights = new ArrayList<FlightInternational>();
//		URLinternationalflightQuery2 = "https://b2c.csair.com/ita/intl/zh/flights?flex=1&m=1&p="+number1+number2+number3+"&t="+c1+"-"+c2+"-"+date+"-"+date2+"&egs=ITA,ITA";
		URLinternationalflightQuery2 = "https://b2c.csair.com/B2C40/modules/bookingnew/inter/flightSelectDirect.html?t=R&c1=PEK&c2=PAR&d1=2019-06-25&d2=2019-06-27&at=1&ct=0&it=0&egs=IBE";
		
		log.info("URLinternationalflightQuery====>"+URLinternationalflightQuery2);
		internationalFlightQuery2 = webClient.getCsairHtmlPage(URLinternationalflightQuery2, "URLinternationalflightQuery2", false);
		HtmlPage page = internationalFlightQuery2.getHtmlPage();
		
		for (int i = 0; i <timeoutmax; i++) {
			//未查询到航班提示
			HtmlDivision alert_error = page.getFirstByXPath("//div[@class='error-info']");
			if (alert_error != null) {
				map.put("cf", c1);
				map.put("dd", c2);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				HtmlDivision qc = page.getFirstByXPath("//div[@class='cities']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='date']");
				
				map.put("qc", qc.asText());// 全程
				map.put("rq", rq.asText());// 日期

				HtmlDivision lk = page.getFirstByXPath("//div[@class='psgs']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span");
				String adult = lkelments.get(0).text();
				String child = lkelments.get(1).text();
				String baby = lkelments.get(2).text();
				map.put("adult", adult);
				map.put("child", child);
				map.put("baby", baby);
				
				if(alert_error != null){
					map.put("noflight", alert_error.asText());
				}
				return map;
			}
			
			//页面的可能展示样式1
			HtmlDivision sh_trip_itemDiv = (HtmlDivision) page.getElementById("sh-trip-item-0-0");
			if(sh_trip_itemDiv != null) {
				map.put("cf", c1);
				map.put("dd", c2);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				HtmlDivision qc = page.getFirstByXPath("//div[@class='cities']");
				HtmlDivision rq = page.getFirstByXPath("//div[@class='date']");
				
				map.put("qc", qc.asText());// 全程
				map.put("rq", rq.asText());// 日期

				HtmlDivision lk = page.getFirstByXPath("//div[@class='psgs']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span");
				String adult = lkelments.get(0).text();
				String child = lkelments.get(1).text();
				String baby = lkelments.get(2).text();
				map.put("adult", adult);
				map.put("child", child);
				map.put("baby", baby);
				
				ArrayList<Cab> list = new ArrayList<Cab>();
				HtmlDivision cabinTab = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "sh-cabin-tab").get(0);
				DomNodeList<HtmlElement> cabinTabLis = cabinTab.getElementsByTagName("li");
				for (int j = 0; j < cabinTabLis.size(); j++) {
					Cab cab = new Cab();
					HtmlListItem cabinTabLi = (HtmlListItem) cabinTabLis.get(j);
					HtmlAnchor cabinTabLiA = (HtmlAnchor) cabinTabLi.getElementsByTagName("a").get(0);
					String cabinTabLiAHref = cabinTabLiA.getAttribute("href");
					String cabinTabLiACab = cabinTabLiA.asText();
					cab.setHref(cabinTabLiAHref);
					cab.setCab(cabinTabLiACab);
					list.add(cab);
				}
				map.put("list", list);
				
				HtmlDivision div = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "sh-list-view z-cab-ctt-0").get(0);
				Document document = Jsoup.parse(div.asXml());
				Elements elements = document.select("div.item");
				
				for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
					Element element = (Element) iterator.next();
					FlightInternational fi = new FlightInternational();
					
					// 起飞时间
					fi.qf_time = element.select("div.sh-intro li strong").get(0).text().trim();
					// 起飞城市
					fi.qf_city = element.select("div.sh-intro li strong").get(0).parent().ownText().trim();
					// 到达时间
					fi.dd_time = element.select("div.sh-intro li strong").get(1).text().trim();
					// 到达城市
					fi.dd_city = element.select("div.sh-intro li strong").get(1).parent().ownText().trim();
					// 航班号
					fi.hbh = element.select("div.caption").get(0).text().trim();
					// 飞机型号
//					f.jx = element.select("div.sp-trip-duration").get(0).text().trim();
					
					Element item1 = element.select("div.sh-cabins").get(0);
					if (item1 != null) {
						Element doc = item1;
						Elements els = doc.select("div.cab-0  span.sh-cab-name");
						if (!els.isEmpty()) {
							fi.cw = els.get(0).html();
						}
					}
					
					Elements item2s = element.select(".cab-0  div.price");
					if(item2s.size() != 0) {
						Element item2 = item2s.get(0);
						if (item2 != null) {
							Element doc = item2;
							Elements els = doc.select("strong");
							if (!els.isEmpty()) {
								fi.price = els.get(0).text().trim();
								System.out.println("fi.price====>"+fi.price);
							}
							fi.shouqing = "0";
						}
					}else {
						fi.shouqing = "1";
					}
					

					Element item3 = element.select("div.sh-cabins a.j-choose").get(0);
					if (item3 != null) {
						fi.yd_id = item3.attr("id").trim();
					}
					
					Element item4 = element.select("a.j-detail").get(0);
					if (item4 != null) {
						fi.xq_href = item4.attr("href");
					}
					flights.add(fi);
				}
				map.put("flights", flights);
				map.put("display0", "none;");
				map.put("mark", "1");
				
				for (int j = 0; j <= timeoutmax; j++) {
					HtmlDivision rls = page.getFirstByXPath("//div[@class='date-bar']");
					List<Kalendar> kalendars = new ArrayList<Kalendar>();
					if (rls != null) {
						Document document1 = Jsoup.parse(rls.asXml());
						Elements elements1 = document1.select("ul li");
						for (Iterator<Element> iterator = elements1.iterator(); iterator.hasNext();) {
							Element li = (Element) iterator.next();
							Kalendar k = new Kalendar();
							k.id = li.attr("data-date").trim();
//							log.info("cls:" + k.id);
							String cls = li.attr("class");
							if (cls != null && cls.trim().contains("current")) {
								k.current = "current";
							}
							k.week = li.select("div.cell  strong").get(0).ownText();
							k.date = li.select("div.cell").get(0).ownText();
							k.price = li.select("div.chart  b").get(0).ownText();
//							log.info(k);
							kalendars.add(k);
						}
						map.put("kalendars", kalendars);
						break;
					}
					synchronized (page) {
						try {
							page.wait(waittime);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
					}
				}
				return map;
			}
			
			//页面可能展示的样式2
			List<HtmlElement> sp_sol_overviews = page.getBody().getElementsByAttribute("div", "class", "sp-sol-overview");
			if(sp_sol_overviews.size() != 0) {
				map.put("cf", c1);
				map.put("dd", c2);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);
				map.put("week", "none");

				String qc = page.getBody().getElementsByAttribute("h3", "class", "sp-trip-title").get(0).asText();
				qc = qc.substring(0, qc.indexOf("20")-1);
				HtmlDivision rq = page.getFirstByXPath("//div[@class='sp-trip-dates line-2']");
				
				map.put("qc", qc);// 全程
				map.put("rq", rq.asText());// 日期

				List<HtmlElement> lkelments = page.getBody().getElementsByAttribute("span", "class", "sp-trip-psg");
				String adult = lkelments.get(0).asText();
				String child = lkelments.get(1).asText();
				String baby = lkelments.get(2).asText();
				map.put("adult", adult);
				map.put("child", child);
				map.put("baby", baby);
				
				HtmlDivision div = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "sp-result").get(0);
				Document document = Jsoup.parse(div.asXml());
				Elements elements = document.select("div.sp-solution");
				for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
					Element element = (Element) iterator.next();
					FlightInternational fi = new FlightInternational();
					
					// 起飞时间
					fi.qf_time = element.select("div.dep strong").get(0).text().trim();
					// 起飞时间2
					fi.qf_time2 = element.select("div.dep strong").get(1).text().trim();
					// 起飞城市
					fi.qf_city = element.select("div.dep").get(0).ownText().trim();
					// 起飞城市2
					fi.qf_city2 = element.select("div.dep").get(1).ownText().trim();
					// 到达时间
					fi.dd_time = element.select("div.arr strong").get(0).text().trim();
					// 到达时间2
					fi.dd_time2 = element.select("div.arr strong").get(1).text().trim();
					// 到达城市
					fi.dd_city = element.select("div.arr").get(0).ownText().trim();
					// 到达城市2
					fi.dd_city2 = element.select("div.arr").get(1).ownText().trim();
					// 航班号
					fi.hbh = element.select("div.sp-sol-slice-flight").get(0).text().trim();
					// 航班号2
					fi.hbh2 = element.select("div.sp-sol-slice-flight").get(1).text().trim();
					// 飞机型号
//					f.jx = element.select("div.sp-trip-duration").get(0).text().trim();
					
					Element item1 = element.select("ul.sp-sol-cell").get(0);
					if (item1 != null) {
						Element doc = item1;
						Elements els = doc.select("div.sp-sol-cell-slice");
						if (!els.isEmpty()) {
							fi.cw = els.get(0).html();
							fi.cw2 = els.get(1).html();
						}
					}

					Element item2 = element.select("li.price").get(0);
					if (item2 != null) {
						Element doc = item2;
						Elements els = doc.select("strong");
						if (!els.isEmpty()) {
							fi.price = els.get(0).text().trim();
							fi.shouqing = "0";
						}
					}

					Element item3 = element.select("a.j-sol-book").get(0);
					if (item3 != null) {
						fi.yd_href = item3.attr("href");
					}
					
					Element item4 = element.select("a.sp-sol-expander").get(0);
					if (item4 != null) {
						fi.xq_href = item4.attr("href");
					}
					flights.add(fi);
				}
				map.put("flights", flights);
				map.put("display0", "none");
				map.put("mark", "2");
				return map;
			}
			
			synchronized (page) {
				try {
					page.wait(2000);
					log.info("加载国际航班查询页WF......");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		System.out.println("加载超时！~~~~~~~~~~~");
		System.out.println(page.asXml());
		return null;
	}
	
	/**
	 * 国际航班详情(样式一)
	 * @param href
	 * @return
	 */
	public Map<String, Object> getInternationalFlightDetails1(String href) {
		
		scl.aaaa = null;
		scl.change3 = null;
		Map<String, Object> map = new HashMap<String, Object>();
		List<InternationalFlightDetails> list = new ArrayList<InternationalFlightDetails>();
		HtmlPage page = internationalFlightQuery.getHtmlPage();
		HtmlDivision item0Div = (HtmlDivision) page.getElementById("sh-trip-item-0-0");
		HtmlDivision listViewDiv = (HtmlDivision) item0Div.getParentNode();
		HtmlAnchor detailsAnchor = (HtmlAnchor) listViewDiv.getElementsByAttribute("a", "href", href).get(0);
//		System.out.println(detailsAnchor.asXml());
//		clickHandler(detailsAnchor);
		
		StringBuilder js = new StringBuilder();
        js.append("$('#sh-trip-item-0-0').parent().find('a[href=").append(href).append("]').click();");
        System.out.println(js.toString());
        page.executeJavaScript(js.toString());

        try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		for (int i = 0; i < timeoutmax; i++) {
				
				HtmlDivision itemDiv = (HtmlDivision) detailsAnchor.getParentNode().getParentNode();
				System.out.println(itemDiv.asXml());
				HtmlDivision zhongzhuanDiv = (HtmlDivision) itemDiv.getElementsByAttribute("div", "class", "sh-details").get(0);
				List<HtmlElement> sendCityStrongs = zhongzhuanDiv.getElementsByAttribute("strong", "class", "ep-part");
				System.out.println("sendCityStrongs.size()==>"+sendCityStrongs.size());
				if(sendCityStrongs.size() > 1) {
					List<HtmlElement> zhongZhuanInfoDivs = zhongzhuanDiv.getElementsByAttribute("div", "class", "transfer");
					if(zhongZhuanInfoDivs.size() != 0) {
						int zhongZhuanInfoDivsSize = zhongZhuanInfoDivs.size();
						System.out.println("zhongZhuanInfoDivsSize===>"+zhongZhuanInfoDivsSize);
						for (int j = 0; j < zhongZhuanInfoDivsSize; j++) {
							InternationalFlightDetails internationalFlightDetails = new InternationalFlightDetails();
							
							HtmlSpan sendTimeSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "time").get(2*j);
							String sendTime = sendTimeSpan.asText();
							log.info("sendTime====>"+sendTime);
							internationalFlightDetails.setSendTime(sendTime);
							
							HtmlSpan arrTimeSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "sp-detail-time").get(2*j+1);
							String arrTime = arrTimeSpan.asText();
							log.info("arrTime====>"+arrTime);
							internationalFlightDetails.setArrTime(arrTime);
							
							HtmlSpan sendDateSpan = (HtmlSpan) sendTimeSpan.getNextElementSibling();
							String sendDate = sendDateSpan.asText();
							log.info("sendDate====>"+sendDate);
							internationalFlightDetails.setSendDate(sendDate);
							
							HtmlSpan arrDateSpan = (HtmlSpan) arrTimeSpan.getNextElementSibling();
							String arrDate = arrDateSpan.asText();
							log.info("arrDate====>"+arrDate);
							internationalFlightDetails.setArrDate(arrDate);
							
							HtmlStrong sendCitySpan = (HtmlStrong) zhongzhuanDiv.getElementsByAttribute("strong", "class", "ep-part").get(2*j);
							String sendCity = sendCitySpan.asText();
							log.info("sendCity====>"+sendCity);
							internationalFlightDetails.setSendCity(sendCity);
							
							HtmlStrong arrCitySpan = (HtmlStrong) zhongzhuanDiv.getElementsByAttribute("strong", "class", "ep-part").get(2*j+1);
							String arrCity = arrCitySpan.asText();
							log.info("arrCity====>"+arrCity);
							internationalFlightDetails.setArrCity(arrCity);
							
							HtmlListItem flightTimeLi = (HtmlListItem) zhongzhuanDiv.getElementsByAttribute("li", "class", "sh-leg-info").get(j);
							String flightTime = flightTimeLi.asText();
							flightTime = flightTime.replace("分钟", "分钟&nbsp;&nbsp;&nbsp; 机型：");
							log.info("flightTime1====>"+flightTime);
							internationalFlightDetails.setFlightTime(flightTime);
							
//							HtmlAnchor jxAnchor = (HtmlAnchor) zhongzhuanDiv.getElementsByAttribute("a", "class", "sp-tip-trigger sp-detail-vehicle").get(j);
//							String jx = jxAnchor.asText();
//							log.info("jx====>"+jx);
//							internationalFlightDetails.setJx(jx);
							
							HtmlDivision hbhDiv = (HtmlDivision) zhongzhuanDiv.getElementsByAttribute("div", "class", "flight").get(j);
							String hbh = hbhDiv.getElementsByTagName("span").get(0).asText();
							log.info("hbh====>"+hbh);
							internationalFlightDetails.setHbh(hbh);
							
							HtmlDivision zhongzhuanInfoDiv = (HtmlDivision) zhongzhuanDiv.getElementsByAttribute("div", "class", "transfer").get(j);
							String zhongzhuanInfo = zhongzhuanInfoDiv.asText();
							log.info("zhongzhuanInfo====>"+zhongzhuanInfo);
							internationalFlightDetails.setZhongzhuanInfo(zhongzhuanInfo);
							
							list.add(internationalFlightDetails);
						}
						map.put("reserve",list);
						
						HtmlSpan sendTimeSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "time").get(2*zhongZhuanInfoDivsSize);
						String sendTime = sendTimeSpan.asText();
						log.info("sendTime1====>"+sendTime);
						map.put("sendTime",sendTime);
						
						HtmlSpan arrTimeSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "time").get(2*zhongZhuanInfoDivsSize+1);
						String arrTime = arrTimeSpan.asText();
						log.info("arrTime1====>"+arrTime);
						map.put("arrTime",arrTime);
						
						HtmlSpan sendDateSpan = (HtmlSpan) sendTimeSpan.getNextElementSibling();
						String sendDate = sendDateSpan.asText();
						log.info("sendDate1====>"+sendDate);
						map.put("sendDate",sendDate);
						
						HtmlSpan arrDateSpan = (HtmlSpan) arrTimeSpan.getNextElementSibling();
						String arrDate = arrDateSpan.asText();
						log.info("arrDate1====>"+arrDate);
						map.put("arrDate",arrDate);
						
						HtmlStrong sendCitySpan = (HtmlStrong) zhongzhuanDiv.getElementsByAttribute("strong", "class", "ep-part").get(2*zhongZhuanInfoDivsSize);
						String sendCity = sendCitySpan.asText();
						log.info("sendCity1====>"+sendCity);
						map.put("sendCity",sendCity);
						
						HtmlStrong arrCitySpan = (HtmlStrong) zhongzhuanDiv.getElementsByAttribute("strong", "class", "ep-part").get(2*zhongZhuanInfoDivsSize+1);
						String arrCity = arrCitySpan.asText();
						log.info("arrCity1====>"+arrCity);
						map.put("arrCity",arrCity);
						
						HtmlListItem flightTimeLi = (HtmlListItem) zhongzhuanDiv.getElementsByAttribute("li", "class", "sh-leg-info").get(zhongZhuanInfoDivsSize);
						String flightTime = flightTimeLi.asText();
						flightTime = flightTime.replace("分钟", "分钟&nbsp;&nbsp;&nbsp; 机型：");
						log.info("flightTime1====>"+flightTime);
						map.put("flightTime",flightTime);
						
						
						HtmlDivision hbhDiv = (HtmlDivision) zhongzhuanDiv.getElementsByAttribute("div", "class", "flight").get(zhongZhuanInfoDivsSize);
						String hbh = hbhDiv.getElementsByTagName("span").get(0).asText();
						log.info("hbh1====>"+hbh);
						map.put("hbh",hbh);
						
						return map;
					}else {
						HtmlSpan sendTimeSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "time").get(0);
						String sendTime = sendTimeSpan.asText();
						log.info("sendTime1====>"+sendTime);
						map.put("sendTime",sendTime);
						
						HtmlSpan arrTimeSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "time").get(1);
						String arrTime = arrTimeSpan.asText();
						log.info("arrTime1====>"+arrTime);
						map.put("arrTime",arrTime);
						
						HtmlSpan sendDateSpan = (HtmlSpan) sendTimeSpan.getNextElementSibling();
						String sendDate = sendDateSpan.asText();
						log.info("sendDate1====>"+sendDate);
						map.put("sendDate",sendDate);
						
						HtmlSpan arrDateSpan = (HtmlSpan) arrTimeSpan.getNextElementSibling();
						String arrDate = arrDateSpan.asText();
						log.info("arrDate1====>"+arrDate);
						map.put("arrDate",arrDate);
						
						HtmlStrong sendCitySpan = (HtmlStrong) zhongzhuanDiv.getElementsByAttribute("strong", "class", "ep-part").get(0);
						String sendCity = sendCitySpan.asText();
						log.info("sendCity1====>"+sendCity);
						map.put("sendCity",sendCity);
						
						HtmlStrong arrCitySpan = (HtmlStrong) zhongzhuanDiv.getElementsByAttribute("strong", "class", "ep-part").get(1);
						String arrCity = arrCitySpan.asText();
						log.info("arrCity1====>"+arrCity);
						map.put("arrCity",arrCity);
						
						HtmlListItem flightTimeLi = (HtmlListItem) zhongzhuanDiv.getElementsByAttribute("li", "class", "sh-leg-info").get(0);
						String flightTime = flightTimeLi.asText();
						flightTime = flightTime.replace("分钟", "分钟&nbsp;&nbsp;&nbsp; 机型：");
						log.info("flightTime1====>"+flightTime);
						map.put("flightTime",flightTime);
						
						HtmlDivision hbhDiv = (HtmlDivision) zhongzhuanDiv.getElementsByAttribute("div", "class", "flight").get(0);
						String hbh = hbhDiv.getElementsByTagName("span").get(0).asText();
						log.info("hbh1====>"+hbh);
						map.put("hbh",hbh);
						
						map.put("reserve", list);
						return map;
					}
				}
			synchronized (page) {
				try {
					page.wait(500);
					log.info("点击详情,加载文件.......");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		return map;
	}
	
	/**
	 * 国际航班详情（样式一）WF
	 * @param href
	 * @return
	 */
	public Map<String, Object> getInternationalFlightDetails1WF(String href) {
		
		scl.aaaa = null;
		scl.change3 = null;
		Map<String, Object> map = new HashMap<String, Object>();
		List<InternationalFlightDetails> list = new ArrayList<InternationalFlightDetails>();
		HtmlPage page = internationalFlightQuery2.getHtmlPage();
		HtmlDivision item0Div = (HtmlDivision) page.getElementById("sh-trip-item-0-0");
		HtmlDivision listViewDiv = (HtmlDivision) item0Div.getParentNode();
		HtmlAnchor detailsAnchor = (HtmlAnchor) listViewDiv.getElementsByAttribute("a", "href", href).get(0);
//		System.out.println(detailsAnchor.asXml());
//		clickHandler(detailsAnchor);
		
		StringBuilder js = new StringBuilder();
        js.append("$('#sh-trip-item-0-0').parent().find('a[href=").append(href).append("]').click();");
        System.out.println(js.toString());
        page.executeJavaScript(js.toString());

        try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		for (int i = 0; i < timeoutmax; i++) {
				
				HtmlDivision itemDiv = (HtmlDivision) detailsAnchor.getParentNode().getParentNode();
				System.out.println(itemDiv.asXml());
				HtmlDivision zhongzhuanDiv = (HtmlDivision) itemDiv.getElementsByAttribute("div", "class", "sh-details").get(0);
				List<HtmlElement> sendCityStrongs = zhongzhuanDiv.getElementsByAttribute("strong", "class", "ep-part");
				System.out.println("sendCityStrongs.size()==>"+sendCityStrongs.size());
				if(sendCityStrongs.size() > 1) {
					List<HtmlElement> zhongZhuanInfoDivs = zhongzhuanDiv.getElementsByAttribute("div", "class", "transfer");
					if(zhongZhuanInfoDivs.size() != 0) {
						int zhongZhuanInfoDivsSize = zhongZhuanInfoDivs.size();
						System.out.println("zhongZhuanInfoDivsSize===>"+zhongZhuanInfoDivsSize);
						for (int j = 0; j < zhongZhuanInfoDivsSize; j++) {
							InternationalFlightDetails internationalFlightDetails = new InternationalFlightDetails();
							
							HtmlSpan sendTimeSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "time").get(2*j);
							String sendTime = sendTimeSpan.asText();
							log.info("sendTime====>"+sendTime);
							internationalFlightDetails.setSendTime(sendTime);
							
							HtmlSpan arrTimeSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "sp-detail-time").get(2*j+1);
							String arrTime = arrTimeSpan.asText();
							log.info("arrTime====>"+arrTime);
							internationalFlightDetails.setArrTime(arrTime);
							
							HtmlSpan sendDateSpan = (HtmlSpan) sendTimeSpan.getNextElementSibling();
							String sendDate = sendDateSpan.asText();
							log.info("sendDate====>"+sendDate);
							internationalFlightDetails.setSendDate(sendDate);
							
							HtmlSpan arrDateSpan = (HtmlSpan) arrTimeSpan.getNextElementSibling();
							String arrDate = arrDateSpan.asText();
							log.info("arrDate====>"+arrDate);
							internationalFlightDetails.setArrDate(arrDate);
							
							HtmlStrong sendCitySpan = (HtmlStrong) zhongzhuanDiv.getElementsByAttribute("strong", "class", "ep-part").get(2*j);
							String sendCity = sendCitySpan.asText();
							log.info("sendCity====>"+sendCity);
							internationalFlightDetails.setSendCity(sendCity);
							
							HtmlStrong arrCitySpan = (HtmlStrong) zhongzhuanDiv.getElementsByAttribute("strong", "class", "ep-part").get(2*j+1);
							String arrCity = arrCitySpan.asText();
							log.info("arrCity====>"+arrCity);
							internationalFlightDetails.setArrCity(arrCity);
							
							HtmlListItem flightTimeLi = (HtmlListItem) zhongzhuanDiv.getElementsByAttribute("li", "class", "sh-leg-info").get(j);
							String flightTime = flightTimeLi.asText();
							flightTime = flightTime.replace("分钟", "分钟&nbsp;&nbsp;&nbsp; 机型：");
							log.info("flightTime1====>"+flightTime);
							internationalFlightDetails.setFlightTime(flightTime);
							
//							HtmlAnchor jxAnchor = (HtmlAnchor) zhongzhuanDiv.getElementsByAttribute("a", "class", "sp-tip-trigger sp-detail-vehicle").get(j);
//							String jx = jxAnchor.asText();
//							log.info("jx====>"+jx);
//							internationalFlightDetails.setJx(jx);
							
							HtmlDivision hbhDiv = (HtmlDivision) zhongzhuanDiv.getElementsByAttribute("div", "class", "flight").get(j);
							String hbh = hbhDiv.getElementsByTagName("span").get(0).asText();
							log.info("hbh====>"+hbh);
							internationalFlightDetails.setHbh(hbh);
							
							HtmlDivision zhongzhuanInfoDiv = (HtmlDivision) zhongzhuanDiv.getElementsByAttribute("div", "class", "transfer").get(j);
							String zhongzhuanInfo = zhongzhuanInfoDiv.asText();
							log.info("zhongzhuanInfo====>"+zhongzhuanInfo);
							internationalFlightDetails.setZhongzhuanInfo(zhongzhuanInfo);
							
							list.add(internationalFlightDetails);
						}
						map.put("reserve",list);
						
						HtmlSpan sendTimeSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "time").get(2*zhongZhuanInfoDivsSize);
						String sendTime = sendTimeSpan.asText();
						log.info("sendTime1====>"+sendTime);
						map.put("sendTime",sendTime);
						
						HtmlSpan arrTimeSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "time").get(2*zhongZhuanInfoDivsSize+1);
						String arrTime = arrTimeSpan.asText();
						log.info("arrTime1====>"+arrTime);
						map.put("arrTime",arrTime);
						
						HtmlSpan sendDateSpan = (HtmlSpan) sendTimeSpan.getNextElementSibling();
						String sendDate = sendDateSpan.asText();
						log.info("sendDate1====>"+sendDate);
						map.put("sendDate",sendDate);
						
						HtmlSpan arrDateSpan = (HtmlSpan) arrTimeSpan.getNextElementSibling();
						String arrDate = arrDateSpan.asText();
						log.info("arrDate1====>"+arrDate);
						map.put("arrDate",arrDate);
						
						HtmlStrong sendCitySpan = (HtmlStrong) zhongzhuanDiv.getElementsByAttribute("strong", "class", "ep-part").get(2*zhongZhuanInfoDivsSize);
						String sendCity = sendCitySpan.asText();
						log.info("sendCity1====>"+sendCity);
						map.put("sendCity",sendCity);
						
						HtmlStrong arrCitySpan = (HtmlStrong) zhongzhuanDiv.getElementsByAttribute("strong", "class", "ep-part").get(2*zhongZhuanInfoDivsSize+1);
						String arrCity = arrCitySpan.asText();
						log.info("arrCity1====>"+arrCity);
						map.put("arrCity",arrCity);
						
						HtmlListItem flightTimeLi = (HtmlListItem) zhongzhuanDiv.getElementsByAttribute("li", "class", "sh-leg-info").get(zhongZhuanInfoDivsSize);
						String flightTime = flightTimeLi.asText();
						flightTime = flightTime.replace("分钟", "分钟&nbsp;&nbsp;&nbsp; 机型：");
						log.info("flightTime1====>"+flightTime);
						map.put("flightTime",flightTime);
						
						
						HtmlDivision hbhDiv = (HtmlDivision) zhongzhuanDiv.getElementsByAttribute("div", "class", "flight").get(zhongZhuanInfoDivsSize);
						String hbh = hbhDiv.getElementsByTagName("span").get(0).asText();
						log.info("hbh1====>"+hbh);
						map.put("hbh",hbh);
						
						return map;
					}else {
						HtmlSpan sendTimeSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "time").get(0);
						String sendTime = sendTimeSpan.asText();
						log.info("sendTime1====>"+sendTime);
						map.put("sendTime",sendTime);
						
						HtmlSpan arrTimeSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "time").get(1);
						String arrTime = arrTimeSpan.asText();
						log.info("arrTime1====>"+arrTime);
						map.put("arrTime",arrTime);
						
						HtmlSpan sendDateSpan = (HtmlSpan) sendTimeSpan.getNextElementSibling();
						String sendDate = sendDateSpan.asText();
						log.info("sendDate1====>"+sendDate);
						map.put("sendDate",sendDate);
						
						HtmlSpan arrDateSpan = (HtmlSpan) arrTimeSpan.getNextElementSibling();
						String arrDate = arrDateSpan.asText();
						log.info("arrDate1====>"+arrDate);
						map.put("arrDate",arrDate);
						
						HtmlStrong sendCitySpan = (HtmlStrong) zhongzhuanDiv.getElementsByAttribute("strong", "class", "ep-part").get(0);
						String sendCity = sendCitySpan.asText();
						log.info("sendCity1====>"+sendCity);
						map.put("sendCity",sendCity);
						
						HtmlStrong arrCitySpan = (HtmlStrong) zhongzhuanDiv.getElementsByAttribute("strong", "class", "ep-part").get(1);
						String arrCity = arrCitySpan.asText();
						log.info("arrCity1====>"+arrCity);
						map.put("arrCity",arrCity);
						
						HtmlListItem flightTimeLi = (HtmlListItem) zhongzhuanDiv.getElementsByAttribute("li", "class", "sh-leg-info").get(0);
						String flightTime = flightTimeLi.asText();
						flightTime = flightTime.replace("分钟", "分钟&nbsp;&nbsp;&nbsp; 机型：");
						log.info("flightTime1====>"+flightTime);
						map.put("flightTime",flightTime);
						
						HtmlDivision hbhDiv = (HtmlDivision) zhongzhuanDiv.getElementsByAttribute("div", "class", "flight").get(0);
						String hbh = hbhDiv.getElementsByTagName("span").get(0).asText();
						log.info("hbh1====>"+hbh);
						map.put("hbh",hbh);
						
						map.put("reserve", list);
						return map;
					}
				}
			synchronized (page) {
				try {
					page.wait(500);
					log.info("点击详情,加载文件.......");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		return map;
	}
	
	/**
	 * 国际航班详情（样式二）
	 * @param href
	 * @return
	 */
	public Map<String, Object> getInternationalFlightDetails2(String href) {
		scl.aaaa = null;
		scl.change3 = null;
		Map<String, Object> map = new HashMap<String, Object>();
		List<InternationalFlightDetails> list = new ArrayList<InternationalFlightDetails>();
		HtmlPage page = internationalFlightQuery.getHtmlPage();
		HtmlAnchor detailsAnchor = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "href", href).get(0);
		System.out.println(detailsAnchor.asXml());
		clickHandler(detailsAnchor);
		for (int i = 0; i < timeoutmax; i++) {
			if(scl.aaaa != null) {
				try {
					Thread.sleep(1000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				HtmlDivision zhongzhuanDiv = (HtmlDivision) detailsAnchor.getParentNode().getNextElementSibling();
				List<HtmlElement> sendCityStrongs = zhongzhuanDiv.getElementsByAttribute("strong", "class", "sp-detail-place");
				System.out.println("sendCityStrongs.size()==>"+sendCityStrongs.size());
				if(sendCityStrongs.size() > 1) {
					List<HtmlElement> zhongZhuanInfoDivs = zhongzhuanDiv.getElementsByAttribute("div", "class", "sp-detail-transfer");
					if(zhongZhuanInfoDivs.size() != 0) {
						int zhongZhuanInfoDivsSize = zhongZhuanInfoDivs.size();
						System.out.println("zhongZhuanInfoDivsSize===>"+zhongZhuanInfoDivsSize);
						for (int j = 0; j < zhongZhuanInfoDivsSize; j++) {
							InternationalFlightDetails internationalFlightDetails = new InternationalFlightDetails();
							
							HtmlSpan sendTimeSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "sp-detail-time").get(2*j);
							String sendTime = sendTimeSpan.asText();
							log.info("sendTime====>"+sendTime);
							internationalFlightDetails.setSendTime(sendTime);
							
							HtmlSpan arrTimeSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "sp-detail-time").get(2*j+1);
							String arrTime = arrTimeSpan.asText();
							log.info("arrTime====>"+arrTime);
							internationalFlightDetails.setArrTime(arrTime);
							
							HtmlSpan sendDateSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "sp-detail-date").get(2*j);
							String sendDate = sendDateSpan.asText();
							log.info("sendDate====>"+sendDate);
							internationalFlightDetails.setSendDate(sendDate);
							
							HtmlSpan arrDateSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "sp-detail-date").get(2*j+1);
							String arrDate = arrDateSpan.asText();
							log.info("arrDate====>"+arrDate);
							internationalFlightDetails.setArrDate(arrDate);
							
							HtmlStrong sendCitySpan = (HtmlStrong) zhongzhuanDiv.getElementsByAttribute("strong", "class", "sp-detail-place").get(2*j);
							String sendCity = sendCitySpan.asText();
							log.info("sendCity====>"+sendCity);
							internationalFlightDetails.setSendCity(sendCity);
							
							HtmlStrong arrCitySpan = (HtmlStrong) zhongzhuanDiv.getElementsByAttribute("strong", "class", "sp-detail-place").get(2*j+1);
							String arrCity = arrCitySpan.asText();
							log.info("arrCity====>"+arrCity);
							internationalFlightDetails.setArrCity(arrCity);
							
							HtmlListItem flightTimeLi = (HtmlListItem) zhongzhuanDiv.getElementsByAttribute("li", "class", "sp-detail-info").get(j);
							String flightTime = flightTimeLi.asText();
							flightTime = flightTime.replace("分钟", "分钟&nbsp;&nbsp;&nbsp; 机型：");
							log.info("flightTime1====>"+flightTime);
							internationalFlightDetails.setFlightTime(flightTime);
							
//							HtmlAnchor jxAnchor = (HtmlAnchor) zhongzhuanDiv.getElementsByAttribute("a", "class", "sp-tip-trigger sp-detail-vehicle").get(j);
//							String jx = jxAnchor.asText();
//							log.info("jx====>"+jx);
//							internationalFlightDetails.setJx(jx);
							
							HtmlDivision hbhDiv = (HtmlDivision) zhongzhuanDiv.getElementsByAttribute("div", "class", "sp-detail-MC").get(j);
							String hbh = hbhDiv.asText();
							log.info("hbh====>"+hbh);
							internationalFlightDetails.setHbh(hbh);
							
							HtmlDivision zhongzhuanInfoDiv = (HtmlDivision) zhongzhuanDiv.getElementsByAttribute("div", "class", "sp-detail-transfer").get(j);
							String zhongzhuanInfo = zhongzhuanInfoDiv.asText();
							log.info("zhongzhuanInfo====>"+zhongzhuanInfo);
							internationalFlightDetails.setZhongzhuanInfo(zhongzhuanInfo);
							
							list.add(internationalFlightDetails);
						}
						map.put("reserve",list);
						
						HtmlSpan sendTimeSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "sp-detail-time").get(2*zhongZhuanInfoDivsSize);
						String sendTime = sendTimeSpan.asText();
						log.info("sendTime1====>"+sendTime);
						map.put("sendTime",sendTime);
						
						HtmlSpan arrTimeSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "sp-detail-time").get(2*zhongZhuanInfoDivsSize+1);
						String arrTime = arrTimeSpan.asText();
						log.info("arrTime1====>"+arrTime);
						map.put("arrTime",arrTime);
						
						HtmlSpan sendDateSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "sp-detail-date").get(2*zhongZhuanInfoDivsSize);
						String sendDate = sendDateSpan.asText();
						log.info("sendDate1====>"+sendDate);
						map.put("sendDate",sendDate);
						
						HtmlSpan arrDateSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "sp-detail-date").get(2*zhongZhuanInfoDivsSize+1);
						String arrDate = arrDateSpan.asText();
						log.info("arrDate1====>"+arrDate);
						map.put("arrDate",arrDate);
						
						HtmlStrong sendCitySpan = (HtmlStrong) zhongzhuanDiv.getElementsByAttribute("strong", "class", "sp-detail-place").get(2*zhongZhuanInfoDivsSize);
						String sendCity = sendCitySpan.asText();
						log.info("sendCity1====>"+sendCity);
						map.put("sendCity",sendCity);
						
						HtmlStrong arrCitySpan = (HtmlStrong) zhongzhuanDiv.getElementsByAttribute("strong", "class", "sp-detail-place").get(2*zhongZhuanInfoDivsSize+1);
						String arrCity = arrCitySpan.asText();
						log.info("arrCity1====>"+arrCity);
						map.put("arrCity",arrCity);
						
						HtmlListItem flightTimeLi = (HtmlListItem) zhongzhuanDiv.getElementsByAttribute("li", "class", "sp-detail-info").get(zhongZhuanInfoDivsSize);
						String flightTime = flightTimeLi.asText();
						flightTime = flightTime.replace("分钟", "分钟&nbsp;&nbsp;&nbsp; 机型：");
						log.info("flightTime1====>"+flightTime);
						map.put("flightTime",flightTime);
						
						
						HtmlDivision hbhDiv = (HtmlDivision) zhongzhuanDiv.getElementsByAttribute("div", "class", "sp-detail-MC").get(zhongZhuanInfoDivsSize);
						String hbh = hbhDiv.asText();
						log.info("hbh1====>"+hbh);
						map.put("hbh",hbh);
						
						return map;
					}else {
						HtmlSpan sendTimeSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "sp-detail-time").get(0);
						String sendTime = sendTimeSpan.asText();
						log.info("sendTime1====>"+sendTime);
						map.put("sendTime",sendTime);
						
						HtmlSpan arrTimeSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "sp-detail-time").get(1);
						String arrTime = arrTimeSpan.asText();
						log.info("arrTime1====>"+arrTime);
						map.put("arrTime",arrTime);
						
						HtmlSpan sendDateSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "sp-detail-date").get(0);
						String sendDate = sendDateSpan.asText();
						log.info("sendDate1====>"+sendDate);
						map.put("sendDate",sendDate);
						
						HtmlSpan arrDateSpan = (HtmlSpan) zhongzhuanDiv.getElementsByAttribute("span", "class", "sp-detail-date").get(1);
						String arrDate = arrDateSpan.asText();
						log.info("arrDate1====>"+arrDate);
						map.put("arrDate",arrDate);
						
						HtmlStrong sendCitySpan = (HtmlStrong) zhongzhuanDiv.getElementsByAttribute("strong", "class", "sp-detail-place").get(0);
						String sendCity = sendCitySpan.asText();
						log.info("sendCity1====>"+sendCity);
						map.put("sendCity",sendCity);
						
						HtmlStrong arrCitySpan = (HtmlStrong) zhongzhuanDiv.getElementsByAttribute("strong", "class", "sp-detail-place").get(1);
						String arrCity = arrCitySpan.asText();
						log.info("arrCity1====>"+arrCity);
						map.put("arrCity",arrCity);
						
						HtmlListItem flightTimeLi = (HtmlListItem) zhongzhuanDiv.getElementsByAttribute("li", "class", "sp-detail-info").get(0);
						String flightTime = flightTimeLi.asText();
						flightTime = flightTime.replace("分钟", "分钟&nbsp;&nbsp;&nbsp; 机型：");
						log.info("flightTime1====>"+flightTime);
						map.put("flightTime",flightTime);
						
						HtmlDivision hbhDiv = (HtmlDivision) zhongzhuanDiv.getElementsByAttribute("div", "class", "sp-detail-MC").get(0);
						String hbh = hbhDiv.asText();
						log.info("hbh1====>"+hbh);
						map.put("hbh",hbh);
						
						map.put("reserve", list);
						return map;
					}
				}
			}
			synchronized (page) {
				try {
					page.wait(500);
					log.info("点击详情,加载文件.......");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		return map;
	}
	
	/**
	 * 国际航班详情WF(样式二)
	 * @param href
	 * @return
	 */
	public Map<String, Object> getInternationalFlightDetails2WF(String href) {
		scl.aaaa = null;
		scl.change3 = null;
		Map<String, Object> map = new HashMap<String, Object>();
		List<InternationalFlightDetails> list = new ArrayList<InternationalFlightDetails>();
		List<InternationalFlightDetails> list1 = new ArrayList<InternationalFlightDetails>();
		HtmlPage page = internationalFlightQuery2.getHtmlPage();
		HtmlAnchor detailsAnchor = (HtmlAnchor) page.getBody().getElementsByAttribute("a", "href", href).get(0);
		System.out.println(detailsAnchor.asXml());
		clickHandler(detailsAnchor);
		for (int i = 0; i < timeoutmax; i++) {
			if(scl.airlines != null) {
				try {
					Thread.sleep(1000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				HtmlDivision zhongzhuanDiv = (HtmlDivision) detailsAnchor.getParentNode().getNextElementSibling();
				List<HtmlElement> tripDivs = zhongzhuanDiv.getElementsByAttribute("div", "class", "sp-detail-trip-section");
				System.out.println("tripDivs.size=========>"+tripDivs.size());
				HtmlDivision tripDiv0 = (HtmlDivision) tripDivs.get(0);
				HtmlDivision tripDiv1 = (HtmlDivision) tripDivs.get(1);
				List<HtmlElement> sendCityStrongs = tripDiv0.getElementsByAttribute("strong", "class", "sp-detail-place");
				List<HtmlElement> sendCityStrongs1 = tripDiv1.getElementsByAttribute("strong", "class", "sp-detail-place");
				System.out.println("sendCityStrongs.size()==>"+sendCityStrongs.size());
				if(sendCityStrongs.size() > 1 && sendCityStrongs1.size()>1) {
					List<HtmlElement> zhongZhuanInfoDivs = tripDiv0.getElementsByAttribute("div", "class", "sp-detail-transfer");
					List<HtmlElement> zhongZhuanInfoDivs1 = tripDiv1.getElementsByAttribute("div", "class", "sp-detail-transfer");
					if(zhongZhuanInfoDivs.size() != 0) {
						int zhongZhuanInfoDivsSize = zhongZhuanInfoDivs.size();
						System.out.println("zhongZhuanInfoDivsSize===>"+zhongZhuanInfoDivsSize);
						for (int j = 0; j < zhongZhuanInfoDivsSize; j++) {
							InternationalFlightDetails internationalFlightDetails = new InternationalFlightDetails();
							
							HtmlSpan sendTimeSpan = (HtmlSpan) tripDiv0.getElementsByAttribute("span", "class", "sp-detail-time").get(2*j);
							String sendTime = sendTimeSpan.asText();
							log.info("sendTime====>"+sendTime);
							internationalFlightDetails.setSendTime(sendTime);
							
							HtmlSpan arrTimeSpan = (HtmlSpan) tripDiv0.getElementsByAttribute("span", "class", "sp-detail-time").get(2*j+1);
							String arrTime = arrTimeSpan.asText();
							log.info("arrTime====>"+arrTime);
							internationalFlightDetails.setArrTime(arrTime);
							
							HtmlSpan sendDateSpan = (HtmlSpan) tripDiv0.getElementsByAttribute("span", "class", "sp-detail-date").get(2*j);
							String sendDate = sendDateSpan.asText();
							log.info("sendDate====>"+sendDate);
							internationalFlightDetails.setSendDate(sendDate);
							
							HtmlSpan arrDateSpan = (HtmlSpan) tripDiv0.getElementsByAttribute("span", "class", "sp-detail-date").get(2*j+1);
							String arrDate = arrDateSpan.asText();
							log.info("arrDate====>"+arrDate);
							internationalFlightDetails.setArrDate(arrDate);
							
							HtmlStrong sendCitySpan = (HtmlStrong) tripDiv0.getElementsByAttribute("strong", "class", "sp-detail-place").get(2*j);
							String sendCity = sendCitySpan.asText();
							log.info("sendCity====>"+sendCity);
							internationalFlightDetails.setSendCity(sendCity);
							
							HtmlStrong arrCitySpan = (HtmlStrong) tripDiv0.getElementsByAttribute("strong", "class", "sp-detail-place").get(2*j+1);
							String arrCity = arrCitySpan.asText();
							log.info("arrCity====>"+arrCity);
							internationalFlightDetails.setArrCity(arrCity);
							
							HtmlListItem flightTimeLi = (HtmlListItem) tripDiv0.getElementsByAttribute("li", "class", "sp-detail-info").get(j);
							String flightTime = flightTimeLi.asText();
							flightTime = flightTime.replace("分钟", "分钟&nbsp;&nbsp;&nbsp; 机型：");
							log.info("flightTime====>"+flightTime);
							internationalFlightDetails.setFlightTime(flightTime);
							
//							HtmlAnchor jxAnchor = (HtmlAnchor) zhongzhuanDiv.getElementsByAttribute("a", "class", "sp-tip-trigger sp-detail-vehicle").get(j);
//							String jx = jxAnchor.asText();
//							log.info("jx====>"+jx);
//							internationalFlightDetails.setJx(jx);
							
							HtmlDivision hbhDiv = (HtmlDivision) tripDiv0.getElementsByAttribute("div", "class", "sp-detail-MC").get(j);
							String hbh = hbhDiv.asText();
							log.info("hbh====>"+hbh);
							internationalFlightDetails.setHbh(hbh);
							
							HtmlDivision zhongzhuanInfoDiv = (HtmlDivision) tripDiv0.getElementsByAttribute("div", "class", "sp-detail-transfer").get(j);
							String zhongzhuanInfo = zhongzhuanInfoDiv.asText();
							log.info("zhongzhuanInfo====>"+zhongzhuanInfo);
							internationalFlightDetails.setZhongzhuanInfo(zhongzhuanInfo);
							
							list.add(internationalFlightDetails);
						}
						map.put("reserve",list);
						
						HtmlSpan sendTimeSpan = (HtmlSpan) tripDiv0.getElementsByAttribute("span", "class", "sp-detail-time").get(2*zhongZhuanInfoDivsSize);
						String sendTime = sendTimeSpan.asText();
						log.info("sendTime1====>"+sendTime);
						map.put("sendTime",sendTime);
						
						HtmlSpan arrTimeSpan = (HtmlSpan) tripDiv0.getElementsByAttribute("span", "class", "sp-detail-time").get(2*zhongZhuanInfoDivsSize+1);
						String arrTime = arrTimeSpan.asText();
						log.info("arrTime1====>"+arrTime);
						map.put("arrTime",arrTime);
						
						HtmlSpan sendDateSpan = (HtmlSpan) tripDiv0.getElementsByAttribute("span", "class", "sp-detail-date").get(2*zhongZhuanInfoDivsSize);
						String sendDate = sendDateSpan.asText();
						log.info("sendDate1====>"+sendDate);
						map.put("sendDate",sendDate);
						
						HtmlSpan arrDateSpan = (HtmlSpan) tripDiv0.getElementsByAttribute("span", "class", "sp-detail-date").get(2*zhongZhuanInfoDivsSize+1);
						String arrDate = arrDateSpan.asText();
						log.info("arrDate1====>"+arrDate);
						map.put("arrDate",arrDate);
						
						HtmlStrong sendCitySpan = (HtmlStrong) tripDiv0.getElementsByAttribute("strong", "class", "sp-detail-place").get(2*zhongZhuanInfoDivsSize);
						String sendCity = sendCitySpan.asText();
						log.info("sendCity1====>"+sendCity);
						map.put("sendCity",sendCity);
						
						HtmlStrong arrCitySpan = (HtmlStrong) tripDiv0.getElementsByAttribute("strong", "class", "sp-detail-place").get(2*zhongZhuanInfoDivsSize+1);
						String arrCity = arrCitySpan.asText();
						log.info("arrCity1====>"+arrCity);
						map.put("arrCity",arrCity);
						
						HtmlListItem flightTimeLi = (HtmlListItem) tripDiv0.getElementsByAttribute("li", "class", "sp-detail-info").get(zhongZhuanInfoDivsSize);
						String flightTime = flightTimeLi.asText();
						flightTime = flightTime.replace("分钟", "分钟&nbsp;&nbsp;&nbsp; 机型：");
						log.info("flightTime1====>"+flightTime);
						map.put("flightTime",flightTime);
						
						
						HtmlDivision hbhDiv = (HtmlDivision) tripDiv0.getElementsByAttribute("div", "class", "sp-detail-MC").get(zhongZhuanInfoDivsSize);
						String hbh = hbhDiv.asText();
						log.info("hbh1====>"+hbh);
						map.put("hbh",hbh);
						
					}else {
						HtmlSpan sendTimeSpan = (HtmlSpan) tripDiv0.getElementsByAttribute("span", "class", "sp-detail-time").get(0);
						String sendTime = sendTimeSpan.asText();
						log.info("sendTime1====>"+sendTime);
						map.put("sendTime",sendTime);
						
						HtmlSpan arrTimeSpan = (HtmlSpan) tripDiv0.getElementsByAttribute("span", "class", "sp-detail-time").get(1);
						String arrTime = arrTimeSpan.asText();
						log.info("arrTime1====>"+arrTime);
						map.put("arrTime",arrTime);
						
						HtmlSpan sendDateSpan = (HtmlSpan) tripDiv0.getElementsByAttribute("span", "class", "sp-detail-date").get(0);
						String sendDate = sendDateSpan.asText();
						log.info("sendDate1====>"+sendDate);
						map.put("sendDate",sendDate);
						
						HtmlSpan arrDateSpan = (HtmlSpan) tripDiv0.getElementsByAttribute("span", "class", "sp-detail-date").get(1);
						String arrDate = arrDateSpan.asText();
						log.info("arrDate1====>"+arrDate);
						map.put("arrDate",arrDate);
						
						HtmlStrong sendCitySpan = (HtmlStrong) tripDiv0.getElementsByAttribute("strong", "class", "sp-detail-place").get(0);
						String sendCity = sendCitySpan.asText();
						log.info("sendCity1====>"+sendCity);
						map.put("sendCity",sendCity);
						
						HtmlStrong arrCitySpan = (HtmlStrong) tripDiv0.getElementsByAttribute("strong", "class", "sp-detail-place").get(1);
						String arrCity = arrCitySpan.asText();
						log.info("arrCity1====>"+arrCity);
						map.put("arrCity",arrCity);
						
						HtmlListItem flightTimeLi = (HtmlListItem) tripDiv0.getElementsByAttribute("li", "class", "sp-detail-info").get(0);
						String flightTime = flightTimeLi.asText();
						flightTime = flightTime.replace("分钟", "分钟&nbsp;&nbsp;&nbsp; 机型：");
						log.info("flightTime1====>"+flightTime);
						map.put("flightTime",flightTime);
						
						HtmlDivision hbhDiv = (HtmlDivision) tripDiv0.getElementsByAttribute("div", "class", "sp-detail-MC").get(0);
						String hbh = hbhDiv.asText();
						log.info("hbh1====>"+hbh);
						map.put("hbh",hbh);
						
					}
					
					
					if(zhongZhuanInfoDivs1.size() != 0) {
						int zhongZhuanInfoDivs1Size = zhongZhuanInfoDivs1.size();
						System.out.println("zhongZhuanInfoDivs1Size===>"+zhongZhuanInfoDivs1Size);
						for (int j = 0; j < zhongZhuanInfoDivs1Size; j++) {
							InternationalFlightDetails internationalFlightDetails1 = new InternationalFlightDetails();
							
							HtmlSpan sendTimeSpan1 = (HtmlSpan) tripDiv1.getElementsByAttribute("span", "class", "sp-detail-time").get(2*j);
							String sendTime1 = sendTimeSpan1.asText();
							log.info("sendTime11====>"+sendTime1);
							internationalFlightDetails1.setSendTime(sendTime1);
							
							HtmlSpan arrTimeSpan1 = (HtmlSpan) tripDiv1.getElementsByAttribute("span", "class", "sp-detail-time").get(2*j+1);
							String arrTime1 = arrTimeSpan1.asText();
							log.info("arrTime11====>"+arrTime1);
							internationalFlightDetails1.setArrTime(arrTime1);
							
							HtmlSpan sendDateSpan1 = (HtmlSpan) tripDiv1.getElementsByAttribute("span", "class", "sp-detail-date").get(2*j);
							String sendDate1 = sendDateSpan1.asText();
							log.info("sendDate11====>"+sendDate1);
							internationalFlightDetails1.setSendDate(sendDate1);
							
							HtmlSpan arrDateSpan1 = (HtmlSpan) tripDiv1.getElementsByAttribute("span", "class", "sp-detail-date").get(2*j+1);
							String arrDate1 = arrDateSpan1.asText();
							log.info("arrDate11====>"+arrDate1);
							internationalFlightDetails1.setArrDate(arrDate1);
							
							HtmlStrong sendCitySpan1 = (HtmlStrong) tripDiv1.getElementsByAttribute("strong", "class", "sp-detail-place").get(2*j);
							String sendCity1 = sendCitySpan1.asText();
							log.info("sendCity11====>"+sendCity1);
							internationalFlightDetails1.setSendCity(sendCity1);
							
							HtmlStrong arrCitySpan1 = (HtmlStrong) tripDiv1.getElementsByAttribute("strong", "class", "sp-detail-place").get(2*j+1);
							String arrCity1 = arrCitySpan1.asText();
							log.info("arrCity11====>"+arrCity1);
							internationalFlightDetails1.setArrCity(arrCity1);
							
							HtmlListItem flightTimeLi1 = (HtmlListItem) tripDiv1.getElementsByAttribute("li", "class", "sp-detail-info").get(j);
							String flightTime1 = flightTimeLi1.asText();
							flightTime1 = flightTime1.replace("分钟", "分钟&nbsp;&nbsp;&nbsp; 机型：");
							log.info("flightTime11====>"+flightTime1);
							internationalFlightDetails1.setFlightTime(flightTime1);
							
//							HtmlAnchor jxAnchor = (HtmlAnchor) zhongzhuanDiv.getElementsByAttribute("a", "class", "sp-tip-trigger sp-detail-vehicle").get(j);
//							String jx = jxAnchor.asText();
//							log.info("jx====>"+jx);
//							internationalFlightDetails.setJx(jx);
							
							HtmlDivision hbhDiv1 = (HtmlDivision) tripDiv1.getElementsByAttribute("div", "class", "sp-detail-MC").get(j);
							String hbh1 = hbhDiv1.asText();
							log.info("hbh11====>"+hbh1);
							internationalFlightDetails1.setHbh(hbh1);
							
							HtmlDivision zhongzhuanInfoDiv1 = (HtmlDivision) tripDiv1.getElementsByAttribute("div", "class", "sp-detail-transfer").get(j);
							String zhongzhuanInfo1 = zhongzhuanInfoDiv1.asText();
							log.info("zhongzhuanInfo11====>"+zhongzhuanInfo1);
							internationalFlightDetails1.setZhongzhuanInfo(zhongzhuanInfo1);
							
							list1.add(internationalFlightDetails1);
						}
						map.put("reserve1",list1);
						
						HtmlSpan sendTimeSpan1 = (HtmlSpan) tripDiv1.getElementsByAttribute("span", "class", "sp-detail-time").get(2*zhongZhuanInfoDivs1Size);
						String sendTime1 = sendTimeSpan1.asText();
						log.info("sendTime12====>"+sendTime1);
						map.put("sendTime1",sendTime1);
						
						HtmlSpan arrTimeSpan1 = (HtmlSpan) tripDiv1.getElementsByAttribute("span", "class", "sp-detail-time").get(2*zhongZhuanInfoDivs1Size+1);
						String arrTime1 = arrTimeSpan1.asText();
						log.info("arrTime12====>"+arrTime1);
						map.put("arrTime1",arrTime1);
						
						HtmlSpan sendDateSpan1 = (HtmlSpan) tripDiv1.getElementsByAttribute("span", "class", "sp-detail-date").get(2*zhongZhuanInfoDivs1Size);
						String sendDate1 = sendDateSpan1.asText();
						log.info("sendDate12====>"+sendDate1);
						map.put("sendDate1",sendDate1);
						
						HtmlSpan arrDateSpan1 = (HtmlSpan) tripDiv1.getElementsByAttribute("span", "class", "sp-detail-date").get(2*zhongZhuanInfoDivs1Size+1);
						String arrDate1 = arrDateSpan1.asText();
						log.info("arrDate12====>"+arrDate1);
						map.put("arrDate1",arrDate1);
						
						HtmlStrong sendCitySpan1 = (HtmlStrong) tripDiv1.getElementsByAttribute("strong", "class", "sp-detail-place").get(2*zhongZhuanInfoDivs1Size);
						String sendCity1 = sendCitySpan1.asText();
						log.info("sendCity12====>"+sendCity1);
						map.put("sendCity1",sendCity1);
						
						HtmlStrong arrCitySpan1 = (HtmlStrong) tripDiv1.getElementsByAttribute("strong", "class", "sp-detail-place").get(2*zhongZhuanInfoDivs1Size+1);
						String arrCity1 = arrCitySpan1.asText();
						log.info("arrCity12====>"+arrCity1);
						map.put("arrCity1",arrCity1);
						
						HtmlListItem flightTimeLi1 = (HtmlListItem) tripDiv1.getElementsByAttribute("li", "class", "sp-detail-info").get(zhongZhuanInfoDivs1Size);
						String flightTime1 = flightTimeLi1.asText();
						flightTime1 = flightTime1.replace("分钟", "分钟&nbsp;&nbsp;&nbsp; 机型：");
						log.info("flightTime12====>"+flightTime1);
						map.put("flightTime1",flightTime1);
						
						
						HtmlDivision hbhDiv1 = (HtmlDivision) tripDiv1.getElementsByAttribute("div", "class", "sp-detail-MC").get(zhongZhuanInfoDivs1Size);
						String hbh1 = hbhDiv1.asText();
						log.info("hbh12====>"+hbh1);
						map.put("hbh1",hbh1);
						
					}else {
						HtmlSpan sendTimeSpan1 = (HtmlSpan) tripDiv1.getElementsByAttribute("span", "class", "sp-detail-time").get(0);
						String sendTime1 = sendTimeSpan1.asText();
						log.info("sendTime12====>"+sendTime1);
						map.put("sendTime1",sendTime1);
						
						HtmlSpan arrTimeSpan1 = (HtmlSpan) tripDiv1.getElementsByAttribute("span", "class", "sp-detail-time").get(1);
						String arrTime1 = arrTimeSpan1.asText();
						log.info("arrTime12====>"+arrTime1);
						map.put("arrTime1",arrTime1);
						
						HtmlSpan sendDateSpan1 = (HtmlSpan) tripDiv1.getElementsByAttribute("span", "class", "sp-detail-date").get(0);
						String sendDate1 = sendDateSpan1.asText();
						log.info("sendDate12====>"+sendDate1);
						map.put("sendDate1",sendDate1);
						
						HtmlSpan arrDateSpan1 = (HtmlSpan) tripDiv1.getElementsByAttribute("span", "class", "sp-detail-date").get(1);
						String arrDate1 = arrDateSpan1.asText();
						log.info("arrDate12====>"+arrDate1);
						map.put("arrDate1",arrDate1);
						
						HtmlStrong sendCitySpan1 = (HtmlStrong) tripDiv1.getElementsByAttribute("strong", "class", "sp-detail-place").get(0);
						String sendCity1 = sendCitySpan1.asText();
						log.info("sendCity12====>"+sendCity1);
						map.put("sendCity1",sendCity1);
						
						HtmlStrong arrCitySpan1 = (HtmlStrong) tripDiv1.getElementsByAttribute("strong", "class", "sp-detail-place").get(1);
						String arrCity1 = arrCitySpan1.asText();
						log.info("arrCity12====>"+arrCity1);
						map.put("arrCity1",arrCity1);
						
						HtmlListItem flightTimeLi1 = (HtmlListItem) tripDiv1.getElementsByAttribute("li", "class", "sp-detail-info").get(0);
						String flightTime1 = flightTimeLi1.asText();
						flightTime1 = flightTime1.replace("分钟", "分钟&nbsp;&nbsp;&nbsp; 机型：");
						log.info("flightTime12====>"+flightTime1);
						map.put("flightTime1",flightTime1);
						
						HtmlDivision hbhDiv1 = (HtmlDivision) tripDiv1.getElementsByAttribute("div", "class", "sp-detail-MC").get(0);
						String hbh1 = hbhDiv1.asText();
						log.info("hbh12====>"+hbh1);
						map.put("hbh1",hbh1);
						
					}
					
					return map;
				}
				
				
			}
			synchronized (page) {
				try {
					page.wait(500);
					log.info("点击详情,加载文件.......");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		return map;
	}
	
	
	/**
	 * 不登录直接购票国际航班
	 */
	@Override
	public Map<String, Object> internationalNologinorder(String href) {
		scl.URLInternationalPassengerInformation = null;
		Map<String, Object> map = new HashMap<String,Object>();
		HtmlPage page = internationalFlightQuery.getHtmlPage();
		List<HtmlElement> as = page.getBody().getElementsByAttribute("a", "class", "j-sol-book");
		for (int i = 0; i < as.size(); i++) {
			HtmlAnchor a = (HtmlAnchor) as.get(i);
			String aHref = a.getAttribute("href");
			System.out.println("aHref====>"+aHref);
			System.out.println("href====>"+href);
			if(href.equals(aHref)) {
				System.out.println("进来了！~~~~~~~~~~~~");
				clickHandler(a);
				break;
			}
			synchronized (page) {
				try {
					page.wait(500);
					log.info("finding href!........");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}

		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision noLogin_btn = (HtmlDivision) page.getElementById("noLogin_btn");
			if(noLogin_btn != null) {
				
				clickHandler(noLogin_btn);
				for (int i1 = 0; i1 <= timeoutmax; i1++) {
					try {
						Thread.sleep(500);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
					log.info("等待返回国际航班旅客信息页面url......");
					if (scl.URLInternationalPassengerInformation != null) {
						log.info("旅客信息页面url=====>" + scl.URLInternationalPassengerInformation);
						map.put("notice", "true");
						return map;
					}
					synchronized (page) {
						try {
							page.wait(500);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						log.info("等待返回url.....");
					}
				}
			}
			synchronized (page) {
				try {
					page.wait(500);
					log.info("加载国际航班购票弹框........");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		
		
		map.put("notice", "false");
		map.put("content", "旅客信息页面获取失败！");
		return map;
	}
	
	/**
	 * 不登录直接购票国际航班WF
	 */
	@Override
	public Map<String, Object> internationalNologinorderWF(String href) {
		scl.URLInternationalPassengerInformation = null;
		Map<String, Object> map = new HashMap<String,Object>();
		HtmlPage page = internationalFlightQuery2.getHtmlPage();
		List<HtmlElement> as = page.getBody().getElementsByAttribute("a", "class", "j-sol-book");
		for (int i = 0; i < as.size(); i++) {
			HtmlAnchor a = (HtmlAnchor) as.get(i);
			String aHref = a.getAttribute("href");
			System.out.println("aHref====>"+aHref);
			System.out.println("href====>"+href);
			if(href.equals(aHref)) {
				System.out.println("进来了！~~~~~~~~~~~~");
				clickHandler(a);
				break;
			}
			synchronized (page) {
				try {
					page.wait(500);
					log.info("finding href!........");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}

		for (int i = 0; i < timeoutmax; i++) {
			HtmlDivision noLogin_btn = (HtmlDivision) page.getElementById("noLogin_btn");
			if(noLogin_btn != null) {
				
				clickHandler(noLogin_btn);
				for (int i1 = 0; i1 <= timeoutmax; i1++) {
					try {
						Thread.sleep(500);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
					log.info("等待返回国际航班旅客信息页面url......");
					if (scl.URLInternationalPassengerInformation != null) {
						log.info("旅客信息页面url=====>" + scl.URLInternationalPassengerInformation);
						map.put("notice", "true");
						return map;
					}
					synchronized (page) {
						try {
							page.wait(500);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
						log.info("等待返回url.....");
					}
				}
			}
			synchronized (page) {
				try {
					page.wait(500);
					log.info("加载国际航班购票弹框........");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		
		map.put("notice", "false");
		map.put("content", "旅客信息页面获取失败！");
		return map;
	}



	/**
	 * 登录状态点击订票国际航班
	 */
	@Override
	public Boolean internationalBuyButton(String href) {
		scl.URLInternationalPassengerInformation = null;
		HtmlPage page = internationalFlightQuery.getHtmlPage();
		List<HtmlElement> as = page.getBody().getElementsByAttribute("a", "class", "j-sol-book");
		for (int i = 0; i < as.size(); i++) {
			HtmlAnchor a = (HtmlAnchor) as.get(i);
			String aHref = a.getAttribute("href");
			if(href.equals(aHref)) {
				clickHandler(a);
				break;
			}
			synchronized (page) {
				try {
					page.wait(500);
					log.info("finding href!........");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		log.info("页面点击订票");
		for (int i = 0; i <= timeoutmax; i++) {
			try {
				Thread.sleep(500);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			log.info("等待返回国际航班旅客信息页面url......");
			if (scl.URLInternationalPassengerInformation != null) {
				log.info("国际航班旅客信息页面url=====>" + scl.URLInternationalPassengerInformation);
				return Boolean.TRUE;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("等待返回url.....");
			}
		}
		return Boolean.FALSE;
	}

	/**
	 * 登录状态点击订票国际航班WF
	 */
	@Override
	public Boolean internationalBuyButtonWF(String href) {
		scl.URLInternationalPassengerInformation = null;
		HtmlPage page = internationalFlightQuery2.getHtmlPage();
		List<HtmlElement> as = page.getBody().getElementsByAttribute("a", "class", "j-sol-book");
		for (int i = 0; i < as.size(); i++) {
			HtmlAnchor a = (HtmlAnchor) as.get(i);
			String aHref = a.getAttribute("href");
			if(href.equals(aHref)) {
				clickHandler(a);
				break;
			}
			synchronized (page) {
				try {
					page.wait(500);
					log.info("finding href!........");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		log.info("页面点击订票");
		for (int i = 0; i <= timeoutmax; i++) {
			try {
				Thread.sleep(500);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			log.info("等待返回国际航班旅客信息页面url......");
			if (scl.URLInternationalPassengerInformation != null) {
				log.info("国际航班旅客信息页面url=====>" + scl.URLInternationalPassengerInformation);
				return Boolean.TRUE;
			}
			synchronized (page) {
				try {
					page.wait(500);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info("等待返回url.....");
			}
		}
		return Boolean.FALSE;
	}
	
	/**
	 * 非登录用户选择登录订票国际航班
	 */
	@Override
	public CsairReturnValue internationalToLoginBuyButton(String href, String username, String password) {
		scl.URLInternationalPassengerInformation = null;
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = internationalFlightQuery.getHtmlPage();
		List<HtmlElement> as = page.getBody().getElementsByAttribute("a", "class", "j-sol-book");
		for (int i = 0; i < as.size(); i++) {
			HtmlAnchor a = (HtmlAnchor) as.get(i);
			String aHref = a.getAttribute("href");
			if(href.equals(aHref)) {
				clickHandler(a);
				break;
			}
			synchronized (page) {
				try {
					page.wait(500);
					log.info("finding href!........");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		for (int i = 0; i < timeoutmax; i++) {
			HtmlInput userNameInput = (HtmlInput) page.getElementById("userId");
			if(userNameInput != null) {
				HtmlForm form = page.getFirstByXPath("//form[@id='memberLogin']");
				page.setFocusedElement(form);
				internationalFlightQuery.setParent(form);
				HtmlInput usernameInput = form.getFirstByXPath("//input[@id='userId']");
				usernameInput.setValueAttribute(username);
				HtmlInput passwordInput = form.getFirstByXPath("//input[@id='passWordPH']");
				page.setFocusedElement(passwordInput);
				HtmlInput realPasswordInput = form.getFirstByXPath("//input[@id='passWord']");
				realPasswordInput.setValueAttribute(password);
				HtmlInput loginProtocol = form.getFirstByXPath("//input[@id='loginProtocol']");
				clickHandler(loginProtocol);
				
				HtmlButton loginButton = form.getFirstByXPath("//button[@id='mem_btn_login']");
				page = clickHandler(loginButton);
				try {
					Thread.sleep(2000);
				} catch (InterruptedException e2) {
					e2.printStackTrace();
				}
				HtmlDivision erro = form.getFirstByXPath("//div[@class='lg-msg error']");
				if (erro != null) {
					returnValue.setMessage(erro.asText());
					return returnValue;
				}
				for (int i1 = 0; i1 <= timeoutmax; i1++) {
					if (scl.URLInternationalPassengerInformation != null) {
						log.info("登录成功!准备进入国际航班旅客信息页");
						returnValue = checkLoginReturnValue(returnValue);
						break;
					}
					synchronized (page) {
						try {
							page.wait(500);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
					}
					log.info("登录中.....");
				}
				break;
			}
			synchronized (page) {
				try {
					page.wait(500);
					log.info("加载国际航班购票弹框........");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		returnValue.setMessage("登录失败，请仔细核对帐号和密码");
		return returnValue;
	}
	
	/**
	 * 非登录用户选择登录订票国际航班样式一
	 */
	@Override
	public CsairReturnValue internationalToLoginBuyButtonStyle1(String id, String username, String password) {
		scl.URLInternationalPassengerInformation = null;
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = internationalFlightQuery.getHtmlPage();
		List<HtmlElement> as = page.getBody().getElementsByAttribute("a", "class", "cm-btn btn-red j-choose");
		for (int i = 0; i < as.size(); i++) {
			HtmlAnchor a = (HtmlAnchor) as.get(i);
			String aId = a.getAttribute("id");
			System.out.println(aId+"  "+id);
			if(id.equals(aId)) {
				clickHandler(a);
				break;
			}
			synchronized (page) {
				try {
					page.wait(500);
					log.info("finding href!........");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		for (int i = 0; i < timeoutmax; i++) {
			HtmlForm loginForm = (HtmlForm) page.getElementById("loginForm");
			if(loginForm != null) {
				HtmlForm form = page.getFirstByXPath("//form[@id='loginForm']");
				page.setFocusedElement(form);
				internationalFlightQuery.setParent(form);
				HtmlInput usernameInput = form.getFirstByXPath("//input[@name='id']");
				usernameInput.focus();
				usernameInput.setValueAttribute(username);
				HtmlInput passwordInput1 = form.getFirstByXPath("//input[@class='ipt u-pwd greyfont _placeholder']");
				passwordInput1.focus();
				HtmlInput passwordInput2 = form.getFirstByXPath("//input[@name='pw']");
				passwordInput2.focus();
				page.setFocusedElement(passwordInput2);
				passwordInput2.setValueAttribute(password);
				HtmlInput loginProtocol = form.getFirstByXPath("//input[@class='lg-check-term']");
				clickHandler(loginProtocol);
				
				HtmlButton loginButton = form.getFirstByXPath("//button[@class='cm-btn submit']");
				page = clickHandler(loginButton);
				System.out.println("page===>"+page);
				try {
					Thread.sleep(2000);
				} catch (InterruptedException e2) {
					e2.printStackTrace();
				}
				HtmlDivision erro = form.getFirstByXPath("//div[@class='lg-msg error']");
				if (erro != null) {
					returnValue.setMessage(erro.asText());
					return returnValue;
				}
				for (int i1 = 0; i1 <= timeoutmax; i1++) {
					if (scl.URLInternationalPassengerInformationStyle1 != null) {
						log.info("登录成功!准备进入国际航班旅客信息页");
						returnValue = checkLoginReturnValue(returnValue);
						internationalPassengerInformationStyle1Page = webClient.getCsairHtmlPage(scl.URLInternationalPassengerInformationStyle1,
								"URLInternationalPassengerInformationStyle1", false);
						CS cs = loadPageHandler(internationalPassengerInformationStyle1Page, "//div[@class='pg-block-body']");
						break;
					}
					synchronized (page) {
						try {
							page.wait(500);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
					}
					log.info("登录中.....");
				}
				break;
			}
			synchronized (page) {
				try {
					page.wait(500);
					log.info("加载国际航班购票弹框........");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		returnValue.setMessage("登录失败，请仔细核对帐号和密码");
		return returnValue;
	}
	
	
	/**
	 * 非登录用户选择登录订票国际航班WF
	 */
	@Override
	public CsairReturnValue internationalToLoginBuyButtonWF(String href, String username, String password) {
		scl.URLInternationalPassengerInformation = null;
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = internationalFlightQuery2.getHtmlPage();
		List<HtmlElement> as = page.getBody().getElementsByAttribute("a", "class", "j-sol-book");
		for (int i = 0; i < as.size(); i++) {
			HtmlAnchor a = (HtmlAnchor) as.get(i);
			String aHref = a.getAttribute("href");
			if(href.equals(aHref)) {
				clickHandler(a);
				break;
			}
			synchronized (page) {
				try {
					page.wait(500);
					log.info("finding href!........");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		for (int i = 0; i < timeoutmax; i++) {
			HtmlInput userNameInput = (HtmlInput) page.getElementById("userId");
			if(userNameInput != null) {
				HtmlForm form = page.getFirstByXPath("//form[@id='memberLogin']");
				page.setFocusedElement(form);
				internationalFlightQuery2.setParent(form);
				HtmlInput usernameInput = form.getFirstByXPath("//input[@id='userId']");
				usernameInput.setValueAttribute(username);
				HtmlInput passwordInput = form.getFirstByXPath("//input[@id='passWordPH']");
				page.setFocusedElement(passwordInput);
				HtmlInput realPasswordInput = form.getFirstByXPath("//input[@id='passWord']");
				realPasswordInput.setValueAttribute(password);
				HtmlInput loginProtocol = form.getFirstByXPath("//input[@id='loginProtocol']");
				clickHandler(loginProtocol);
				
				HtmlButton loginButton = form.getFirstByXPath("//button[@id='mem_btn_login']");
				page = clickHandler(loginButton);
				try {
					Thread.sleep(2000);
				} catch (InterruptedException e2) {
					e2.printStackTrace();
				}
				HtmlDivision erro = form.getFirstByXPath("//div[@class='lg-msg error']");
				if (erro != null) {
					returnValue.setMessage(erro.asText());
					return returnValue;
				}
				for (int i1 = 0; i1 <= timeoutmax; i1++) {
					if (scl.URLInternationalPassengerInformation != null) {
						log.info("登录成功!准备进入国际航班旅客信息页");
						returnValue = checkLoginReturnValue(returnValue);
						break;
					}
					synchronized (page) {
						try {
							page.wait(200);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
					}
					log.info("登录中.....");
				}
				break;
			}
			synchronized (page) {
				try {
					page.wait(500);
					log.info("加载国际航班购票弹框........");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		returnValue.setMessage("登录失败，请仔细核对帐号和密码");
		return returnValue;
	}

	
	
	
	/**
	 * 加载国际航班旅客信息页面的旅客信息Style2
	 */
	@Override
	public Map<String, Object> loadInternationalFilightInfo() {
		Map<String, Object> map = new HashMap<String, Object>();
		log.info("加载旅客信息页面url:" + scl.URLInternationalPassengerInformation);
		if (scl.URLInternationalPassengerInformation != null) {
			long t1 = System.currentTimeMillis();
			internationalPassengerInformationPage = webClient.getCsairHtmlPage(scl.URLInternationalPassengerInformation,
					"URLInternationalPassengerInformation", false);
			CS cs = loadPageHandler(internationalPassengerInformationPage, "//table[@class='summary-sub']");
			try {
				Thread.sleep(500);
			} catch (InterruptedException e1) {
				e1.printStackTrace();
			}
			if (cs == CS.SUCCESS) {
				HtmlPage page = internationalPassengerInformationPage.getHtmlPage();
				// log.info(page.asXml());
				// HtmlTable valid = page.getFirstByXPath("//table[@class='summary-sub']");
				for (int i = 0; i < timeoutmax; i++) {
					List<HtmlElement> textBoxs = page.getBody().getElementsByAttribute("div", "class", "text-box");
					List<HtmlElement> topTxtDivs = page.getBody().getElementsByAttribute("div", "class", "passenger-nologin psg-topTxt");
					List<HtmlElement> baoxianInputs = page.getBody().getElementsByAttribute("input", "name", "ins");
					if(textBoxs.size()!=0) {
						try {
							Thread.sleep(1000);
						} catch (InterruptedException e1) {
							e1.printStackTrace();
						}
						HtmlDivision textBox = (HtmlDivision) textBoxs.get(0);
						HtmlAnchor noBX = (HtmlAnchor) textBox.getElementsByTagName("a").get(1);
						clickHandler(noBX);

						for (int j = 0; j < timeoutmax; j++) {
							if(topTxtDivs.size() != 0) {
								long t2 = System.currentTimeMillis();
								HtmlDivision div = page.getFirstByXPath("//div[@class='flight-summary-box']");
								Document doc = Jsoup.parse(div.asXml());
								Elements boxes = doc.select("div#flight-summary-box .singleFlightBox");
								List<InternationalFlightInfo> fiList = new ArrayList<InternationalFlightInfo>();
								for (int i1 = 0; i1 < boxes.size(); i1++) {
									InternationalFlightInfo internationalFlightInfo1 = new InternationalFlightInfo();
									List<FlightSummary> list = new ArrayList<FlightSummary>();
									Element tb = boxes.get(i1);
									internationalFlightInfo1.flight_name = tb.select(".flight-name").get(0).text();
									Elements trs = tb.select("tr");
									for (int k = 1; k < trs.size(); k++) {
										FlightSummary flightSummary = new FlightSummary();
										Element tr = trs.get(k);
										Elements tds = tr.select("td");
										Element td0 = tds.get(0);
										flightSummary.qf_city = td0.select("span.flight-city").get(0).ownText();// 起飞城市
										System.out.println("flightSummary.qf_city===>"+flightSummary.qf_city);
										flightSummary.qf_time = td0.select("span.marginLeft").text();// 起飞时间flight-date
										System.out.println("flightSummary.qf_time===>"+flightSummary.qf_time);
										flightSummary.qf_date = td0.select("span.flight-date").text();// 起飞时间
										System.out.println("flightSummary.qf_date===>"+flightSummary.qf_date);
										Element td1 = tds.get(1);
										flightSummary.hbh = td1.select("span").text();
										System.out.println("flightSummary.hbh===>"+flightSummary.hbh);
										Element td2 = tds.get(2);
										flightSummary.dd_city = td2.select("span.flight-city").get(0).ownText();// 到达城市
										System.out.println("flightSummary.dd_city===>"+flightSummary.dd_city);
										flightSummary.dd_time = td2.select("span.marginLeft").text();// 到达时间
										System.out.println("flightSummary.dd_time===>"+flightSummary.dd_time);
										flightSummary.dd_date = td2.select("span.flight-date").text();// 到达时间
										System.out.println("flightSummary.dd_date===>"+flightSummary.dd_date);
										Element td3 = tds.get(3);
										flightSummary.cx = td3.text();
										System.out.println("flightSummary.cx===>"+flightSummary.cx);
										list.add(flightSummary);
									}
									internationalFlightInfo1.setFlightSummaryList(list);
									fiList.add(internationalFlightInfo1);
								}
								// 概述完成
								InternationalFlightInfo internationalFlightInfo = new InternationalFlightInfo();
								Elements subTbs = doc.select("div#summary-sub-box table tr");
								for (int k = 1; k < subTbs.size(); k++) {
									Element tr = subTbs.get(k);
									internationalFlightInfo.infos[k - 1].lk = tr.select("td").get(0).text();
									internationalFlightInfo.infos[k - 1].pj = tr.select("td").get(1).text();
									internationalFlightInfo.infos[k - 1].ryf = tr.select("td").get(2).text();
								}
								internationalFlightInfo.total = doc.select("div#price-total span").text();
								System.out.println("internationalFlightInfo.total====>"+internationalFlightInfo.total);
								
								//常用旅客
//								map.put("cpDiv", 0);
//								HtmlDivision commonPassengerListDiv = (HtmlDivision) page.getElementById("common-passenger-list");
//								System.out.println("commonPassengerListDiv===>"+commonPassengerListDiv);
//								if(commonPassengerListDiv != null ) {
//									List<CommonPassenger> cpList = new ArrayList<CommonPassenger>();
//									for (int i1 = 0; i1 < timeoutmax; i1++) {
//										DomNodeList<HtmlElement> as = commonPassengerListDiv.getElementsByTagName("a");
////										log.info("as.size()===>"+as.size());
//										if(scl.getSvcEPassenger != null && as.size() != 0) {
//											for (int i11 = 0; i11 < as.size(); i11++) {
//												CommonPassenger commonPassenger = new CommonPassenger();
//												String id = as.get(i11).getAttribute("id");
//												String name = as.get(i11).asText();
//												String aclass = as.get(i11).getAttribute("class");
//												if(aclass.contains("used")) {
//													commonPassenger.setChecked("checked");
//												}
////												log.info("id====>"+id+",name===>"+name);
//												commonPassenger.setId(id);
//												commonPassenger.setName(name);
//												cpList.add(commonPassenger);
//											}
//											map.put("cpDiv", 1);
//											map.put("cpList", cpList);
//											break;
//										}
//										synchronized (page) {
//											try {
//												page.wait(500);
//											} catch (InterruptedException e) {
												// TODO Auto-generated catch block
//												e.printStackTrace();
//											}
//											log.info("加载常用旅客信息......");
//										}
//									}
//									
//								}
								
								
								List<FlightPassenger> fpList = new ArrayList<FlightPassenger>();
								HtmlElement ulList = (HtmlElement) page.getElementById("passenger-list");
								Document doc1 = Jsoup.parse(ulList.asXml());
								Elements lis = doc1.select("li");
								for (int k = 0; k < lis.size(); k++) {
									FlightPassenger flightPassenger = new FlightPassenger();
									Element li = lis.get(k);
//									log.info(li.toString());
									flightPassenger.pType = li.attr("data-type");
									log.info("flightPassenger.pType==>" + flightPassenger.pType);
									flightPassenger.name1 = li.select("input[name=pName1]").first().val();
//									log.info("name1====>" + flightPassenger.name1);
									flightPassenger.name2 = li.select("input[name=pName2]").first().val();
//									log.info("name2====>" + flightPassenger.name2);
									flightPassenger.pIdType = li.select("div.select-trigger").get(1).text();
//									log.info("flightPassenger.pIdType==>" + flightPassenger.pIdType);
									flightPassenger.idNO = li.select("input[name=pIdCard]").first().val();
//									log.info("idNo====>" + flightPassenger.idNO);

									if (li.select("input[name=pBirthday]").size() != 0) {
										flightPassenger.birthday = li.select("input[name=pBirthday]").first().val();
//										log.info("出生日期==>" + flightPassenger.birthday);
									}

									if (li.select("div.psgs-carryByName").size() != 0) {
										flightPassenger.takeName = li.select("div.psgs-carryByName").first().html();
//										log.info("婴儿携带者===>" + flightPassenger.takeName);
									}
									flightPassenger.liId = li.attr("id");
									log.info("flightPassenger.liId==>" + flightPassenger.liId);


									fpList.add(flightPassenger);
								}
								
								List<Country> countryList = new ArrayList<Country>();
								HtmlInput pNationalityInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "name", "pNationality").get(0);
								pNationalityInput.focus();
								clickHandler(pNationalityInput);
								for (int k = 0; k < timeoutmax; k++) {
									HtmlDivision undefinedDiv = (HtmlDivision) page.getElementById("undefined-div");
									if(undefinedDiv != null) {
										DomNodeList<HtmlElement> undefinedDivLis = undefinedDiv.getElementsByTagName("li");
										for (int l = 0; l < undefinedDivLis.size(); l++) {
											Country country = new Country();
											HtmlListItem li = (HtmlListItem) undefinedDivLis.get(l);
											HtmlAnchor a = (HtmlAnchor) li.getElementsByTagName("a").get(0);
											String href = a.getAttribute("href");
											String countryName = a.asText();
											country.setCountryHref(href);
											country.setCountryName(countryName);
											countryList.add(country);
										}
										map.put("countryList", countryList);
										break;
									}
									synchronized (page) {
										try {
											page.wait(500);
											log.info("加载国家地区信息.......");
										} catch (InterruptedException e) {
											e.printStackTrace();
										}
									}
								}
								
								HtmlInput contact_nameInput = (HtmlInput) page.getElementById("contact_name");
								String contact_name = contact_nameInput.getAttribute("value");
								map.put("contact_name", contact_name);
								log.info("contact_name==>" + contact_name);
								
								internationalPassengerInformationPage.setLS(CS.SUCCESS);
								log.info(internationalPassengerInformationPage.getLS());
								map.put("filist", fiList);
								map.put("fplist", fpList);
								map.put("internationalFlightInfo", internationalFlightInfo);
								map.put("baoxian", "0");
								long t3 = System.currentTimeMillis();
								double chuliTime =  ((t3-t2)/1000.0);
								double totleTime = ((t3-t1)/1000.0);
								double nanhangTime = totleTime - chuliTime;
								log.info("南航官网用时："+nanhangTime+"s,无障碍处理用时："+chuliTime+"s,总用时："+totleTime+"s");
								
								map.put("Time", "南航官网用时："+nanhangTime+"s,无障碍处理用时："+chuliTime+"s,总用时："+totleTime+"s");
								return map;
							
							}
							
							synchronized (page) {
								try {
									page.wait(500);
									log.info("load div.style......");
								} catch (InterruptedException e) {
									// TODO Auto-generated catch block
									e.printStackTrace();
								}
							}
						}
						HtmlInput pNationalityInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "name", "pNationality").get(0);
						pNationalityInput.focus();
						clickHandler(pNationalityInput);
						HtmlInput pIdputcountryInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "name", "pIdputcountry").get(0);
						pIdputcountryInput.focus();
						clickHandler(pIdputcountryInput);
						
						List<HtmlElement> ac_resultsDivs = page.getBody().getElementsByAttribute("div", "class", "ac_results");
						System.out.println("ac_resultsDivs.size()===>"+ac_resultsDivs.size());
						
						break;
					}else if(topTxtDivs.size() != 0 && baoxianInputs.size() != 0) {
						HtmlDivision topTxtDiv = (HtmlDivision) topTxtDivs.get(0);
						for (int j = 0; j < timeoutmax; j++) {
							String topTxtDivStyle = topTxtDiv.getAttribute("style");
							if(topTxtDivStyle.contains("block")) {
								
								long t2 = System.currentTimeMillis();
								HtmlDivision div = page.getFirstByXPath("//div[@class='flight-summary-box']");
								Document doc = Jsoup.parse(div.asXml());
								Elements boxes = doc.select("div#flight-summary-box .singleFlightBox");
								List<InternationalFlightInfo> fiList = new ArrayList<InternationalFlightInfo>();
								for (int i1 = 0; i1 < boxes.size(); i1++) {
									InternationalFlightInfo internationalFlightInfo1 = new InternationalFlightInfo();
									List<FlightSummary> list = new ArrayList<FlightSummary>();
									Element tb = boxes.get(i1);
									internationalFlightInfo1.flight_name = tb.select(".flight-name").get(0).text();
									Elements trs = tb.select("tr");
									for (int k = 1; k < trs.size(); k++) {
										FlightSummary flightSummary = new FlightSummary();
										Element tr = trs.get(k);
										Elements tds = tr.select("td");
										Element td0 = tds.get(0);
										flightSummary.qf_city = td0.select("span.flight-city").get(0).ownText();// 起飞城市
										System.out.println("flightSummary.qf_city===>"+flightSummary.qf_city);
										flightSummary.qf_time = td0.select("span.marginLeft").text();// 起飞时间flight-date
										System.out.println("flightSummary.qf_time===>"+flightSummary.qf_time);
										flightSummary.qf_date = td0.select("span.flight-date").text();// 起飞时间
										System.out.println("flightSummary.qf_date===>"+flightSummary.qf_date);
										Element td1 = tds.get(1);
										flightSummary.hbh = td1.select("span").text();
										System.out.println("flightSummary.hbh===>"+flightSummary.hbh);
										Element td2 = tds.get(2);
										flightSummary.dd_city = td2.select("span.flight-city").get(0).ownText();// 到达城市
										System.out.println("flightSummary.dd_city===>"+flightSummary.dd_city);
										flightSummary.dd_time = td2.select("span.marginLeft").text();// 到达时间
										System.out.println("flightSummary.dd_time===>"+flightSummary.dd_time);
										flightSummary.dd_date = td2.select("span.flight-date").text();// 到达时间
										System.out.println("flightSummary.dd_date===>"+flightSummary.dd_date);
										Element td3 = tds.get(3);
										flightSummary.cx = td3.text();
										System.out.println("flightSummary.cx===>"+flightSummary.cx);
										list.add(flightSummary);
									}
									internationalFlightInfo1.setFlightSummaryList(list);
									fiList.add(internationalFlightInfo1);
								}
								// 概述完成
								InternationalFlightInfo internationalFlightInfo = new InternationalFlightInfo();
								Elements subTbs = doc.select("div#summary-sub-box table tr");
								for (int k = 1; k < subTbs.size(); k++) {
									Element tr = subTbs.get(k);
									internationalFlightInfo.infos[k - 1].lk = tr.select("td").get(0).text();
									internationalFlightInfo.infos[k - 1].pj = tr.select("td").get(1).text();
									internationalFlightInfo.infos[k - 1].ryf = tr.select("td").get(2).text();
								}
								internationalFlightInfo.total = doc.select("div#price-total span").text();
								System.out.println("internationalFlightInfo.total====>"+internationalFlightInfo.total);
								
								//常用旅客
								map.put("cpDiv", 0);
								HtmlDivision commonPassengerListDiv = (HtmlDivision) page.getElementById("common-passenger-list");
								System.out.println("commonPassengerListDiv===>"+commonPassengerListDiv);
								if(commonPassengerListDiv != null ) {
									List<CommonPassenger> cpList = new ArrayList<CommonPassenger>();
									for (int i1 = 0; i1 < timeoutmax; i1++) {
										DomNodeList<HtmlElement> as = commonPassengerListDiv.getElementsByTagName("a");
//										log.info("as.size()===>"+as.size());
										if(scl.getSvcEPassenger != null && as.size() != 0) {
											for (int i11 = 0; i11 < as.size(); i11++) {
												CommonPassenger commonPassenger = new CommonPassenger();
												String id = as.get(i11).getAttribute("id");
												String name = as.get(i11).asText();
												String aclass = as.get(i11).getAttribute("class");
												if(aclass.contains("used")) {
													commonPassenger.setChecked("checked");
												}
//												log.info("id====>"+id+",name===>"+name);
												commonPassenger.setId(id);
												commonPassenger.setName(name);
												cpList.add(commonPassenger);
											}
											map.put("cpDiv", 1);
											map.put("cpList", cpList);
											break;
										}
										synchronized (page) {
											try {
												page.wait(500);
											} catch (InterruptedException e) {
												// TODO Auto-generated catch block
												e.printStackTrace();
											}
											log.info("加载常用旅客信息......");
										}
									}
									
								}
								
								
								List<FlightPassenger> fpList = new ArrayList<FlightPassenger>();
								HtmlElement ulList = (HtmlElement) page.getElementById("passenger-list");
								Document doc1 = Jsoup.parse(ulList.asXml());
								Elements lis = doc1.select("li");
								for (int k = 0; k < lis.size(); k++) {
									FlightPassenger flightPassenger = new FlightPassenger();
									Element li = lis.get(k);
//									log.info(li.toString());
									flightPassenger.pType = li.attr("data-type");
//									log.info("flightPassenger.pType==>" + flightPassenger.pType);
									flightPassenger.name1 = li.select("input[name=pName1]").first().val();
//									log.info("name1====>" + flightPassenger.name1);
									flightPassenger.name2 = li.select("input[name=pName2]").first().val();
//									log.info("name2====>" + flightPassenger.name2);
									flightPassenger.pIdType = li.select("div.select-trigger").get(1).text();
//									log.info("flightPassenger.pIdType==>" + flightPassenger.pIdType);
									flightPassenger.idNO = li.select("input[name=pIdCard]").first().val();
//									log.info("idNo====>" + flightPassenger.idNO);

									if (li.select("input[name=pBirthday]").size() != 0) {
										flightPassenger.birthday = li.select("input[name=pBirthday]").first().val();
//										log.info("出生日期==>" + flightPassenger.birthday);
									}

									if (li.select("div.psgs-carryByName").size() != 0) {
										flightPassenger.takeName = li.select("div.psgs-carryByName").first().html();
//										log.info("婴儿携带者===>" + flightPassenger.takeName);
									}
									flightPassenger.liId = li.attr("id");
									log.info("flightPassenger.liId==>" + flightPassenger.liId);

									HtmlInput zhx = (HtmlInput) page.getBody().getElementsByAttribute("input", "value", "a").get(0);
									flightPassenger.ir0Check = zhx.isChecked();
									log.info("综合险check====>" + flightPassenger.ir0Check);

									flightPassenger.ir0Money = li.select("span.ins-cost").get(0).text();
									log.info("综合险金额===>" + flightPassenger.ir0Money);


									fpList.add(flightPassenger);
								}
								
								HtmlInput contact_nameInput = (HtmlInput) page.getElementById("contact_name");
								String contact_name = contact_nameInput.getAttribute("value");
								map.put("contact_name", contact_name);
								log.info("contact_name==>" + contact_name);
//								HtmlInput contact_moblieInput = (HtmlInput) page.getElementById("contact-moblie");
//								String contact_moblie = contact_moblieInput.getAttribute("mobile");
//								map.put("contact_moblie", contact_moblie);
//								log.info("contact_moblie==>" + contact_moblie);
//								HtmlInput emailInput = (HtmlInput) page.getElementById("email");
//								String email = emailInput.getAttribute("email");
//								map.put("email", email);
//								log.info("email==>" + email);
								
								internationalPassengerInformationPage.setLS(CS.SUCCESS);
								log.info(internationalPassengerInformationPage.getLS());
								map.put("filist", fiList);
								map.put("fplist", fpList);
								map.put("internationalFlightInfo", internationalFlightInfo);
								map.put("baoxian", "1");
								long t3 = System.currentTimeMillis();
								double chuliTime =  ((t3-t2)/1000.0);
								double totleTime = ((t3-t1)/1000.0);
								double nanhangTime = totleTime - chuliTime;
								log.info("南航官网用时："+nanhangTime+"s,无障碍处理用时："+chuliTime+"s,总用时："+totleTime+"s");
								
								map.put("Time", "南航官网用时："+nanhangTime+"s,无障碍处理用时："+chuliTime+"s,总用时："+totleTime+"s");
								return map;
							
							}
							
							synchronized (page) {
								try {
									page.wait(500);
									log.info("load div.style......");
								} catch (InterruptedException e) {
									// TODO Auto-generated catch block
									e.printStackTrace();
								}
							}
						}
						break;
					}
					
					
					synchronized (page) {
						try {
							page.wait(500);
							log.info("loading page......");
						} catch (InterruptedException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
					}
				}
				
			}
			internationalPassengerInformationPage.setLS(CS.TIMEOUT);
			log.info(internationalPassengerInformationPage.getLS());
		}
		return null;
	}
	
	
	/**
	 * 加载国际航班旅客信息页面的旅客信息Style1
	 */
	@Override
	public Map<String, Object> loadInternationalFilightInfoStyle1() {
		Map<String, Object> map = new HashMap<String, Object>();
		log.info("加载旅客信息页面url:" + scl.URLInternationalPassengerInformationStyle1);
		if (scl.URLInternationalPassengerInformationStyle1 != null) {
			long t1 = System.currentTimeMillis();
			internationalPassengerInformationStyle1Page = webClient.getCsairHtmlPage(scl.URLInternationalPassengerInformationStyle1,
					"URLInternationalPassengerInformationStyle1", false);
			CS cs = loadPageHandler(internationalPassengerInformationStyle1Page, "//div[@class='pg-block-body']");
//			try {
//				Thread.sleep(500);
//			} catch (InterruptedException e1) {
//				e1.printStackTrace();
//			}
//			if (cs == CS.SUCCESS) {
				HtmlPage page = internationalPassengerInformationStyle1Page.getHtmlPage();
				
				 log.info(page.asXml());
				// HtmlTable valid = page.getFirstByXPath("//table[@class='summary-sub']");
				for (int i = 0; i < timeoutmax; i++) {
					List<HtmlElement> topTxtDivs = page.getBody().getElementsByAttribute("div", "class", "pg-block-body");
					List<HtmlElement> baoxianInputs = page.getBody().getElementsByAttribute("input", "name", "p-doc");
					HtmlDivision loginForms = (HtmlDivision) page.getElementById("cm-login-forms");
					
					if(topTxtDivs.size() != 0 && baoxianInputs.size() != 0) {
						HtmlDivision topTxtDiv = (HtmlDivision) topTxtDivs.get(0);
						for (int j = 0; j < timeoutmax; j++) {
							String topTxtDivStyle = topTxtDiv.getAttribute("style");
							if(topTxtDivStyle.contains("block")) {
								
								long t2 = System.currentTimeMillis();
								HtmlDivision div = page.getFirstByXPath("//div[@class='flight-summary-box']");
								Document doc = Jsoup.parse(div.asXml());
								Elements boxes = doc.select("div#flight-summary-box .singleFlightBox");
								List<InternationalFlightInfo> fiList = new ArrayList<InternationalFlightInfo>();
								for (int i1 = 0; i1 < boxes.size(); i1++) {
									InternationalFlightInfo internationalFlightInfo1 = new InternationalFlightInfo();
									List<FlightSummary> list = new ArrayList<FlightSummary>();
									Element tb = boxes.get(i1);
									internationalFlightInfo1.flight_name = tb.select(".flight-name").get(0).text();
									Elements trs = tb.select("tr");
									for (int k = 1; k < trs.size(); k++) {
										FlightSummary flightSummary = new FlightSummary();
										Element tr = trs.get(k);
										Elements tds = tr.select("td");
										Element td0 = tds.get(0);
										flightSummary.qf_city = td0.select("span.flight-city").get(0).ownText();// 起飞城市
										System.out.println("flightSummary.qf_city===>"+flightSummary.qf_city);
										flightSummary.qf_time = td0.select("span.marginLeft").text();// 起飞时间flight-date
										System.out.println("flightSummary.qf_time===>"+flightSummary.qf_time);
										flightSummary.qf_date = td0.select("span.flight-date").text();// 起飞时间
										System.out.println("flightSummary.qf_date===>"+flightSummary.qf_date);
										Element td1 = tds.get(1);
										flightSummary.hbh = td1.select("span").text();
										System.out.println("flightSummary.hbh===>"+flightSummary.hbh);
										Element td2 = tds.get(2);
										flightSummary.dd_city = td2.select("span.flight-city").get(0).ownText();// 到达城市
										System.out.println("flightSummary.dd_city===>"+flightSummary.dd_city);
										flightSummary.dd_time = td2.select("span.marginLeft").text();// 到达时间
										System.out.println("flightSummary.dd_time===>"+flightSummary.dd_time);
										flightSummary.dd_date = td2.select("span.flight-date").text();// 到达时间
										System.out.println("flightSummary.dd_date===>"+flightSummary.dd_date);
										Element td3 = tds.get(3);
										flightSummary.cx = td3.text();
										System.out.println("flightSummary.cx===>"+flightSummary.cx);
										list.add(flightSummary);
									}
									internationalFlightInfo1.setFlightSummaryList(list);
									fiList.add(internationalFlightInfo1);
								}
								// 概述完成
								InternationalFlightInfo internationalFlightInfo = new InternationalFlightInfo();
								Elements subTbs = doc.select("div#summary-sub-box table tr");
								for (int k = 1; k < subTbs.size(); k++) {
									Element tr = subTbs.get(k);
									internationalFlightInfo.infos[k - 1].lk = tr.select("td").get(0).text();
									internationalFlightInfo.infos[k - 1].pj = tr.select("td").get(1).text();
									internationalFlightInfo.infos[k - 1].ryf = tr.select("td").get(2).text();
								}
								internationalFlightInfo.total = doc.select("div#price-total span").text();
								System.out.println("internationalFlightInfo.total====>"+internationalFlightInfo.total);
								
								//常用旅客
								map.put("cpDiv", 0);
								HtmlDivision commonPassengerListDiv = (HtmlDivision) page.getElementById("common-passenger-list");
								System.out.println("commonPassengerListDiv===>"+commonPassengerListDiv);
								if(commonPassengerListDiv != null ) {
									List<CommonPassenger> cpList = new ArrayList<CommonPassenger>();
									for (int i1 = 0; i1 < timeoutmax; i1++) {
										DomNodeList<HtmlElement> as = commonPassengerListDiv.getElementsByTagName("a");
//										log.info("as.size()===>"+as.size());
										if(scl.getSvcEPassenger != null && as.size() != 0) {
											for (int i11 = 0; i11 < as.size(); i11++) {
												CommonPassenger commonPassenger = new CommonPassenger();
												String id = as.get(i11).getAttribute("id");
												String name = as.get(i11).asText();
												String aclass = as.get(i11).getAttribute("class");
												if(aclass.contains("used")) {
													commonPassenger.setChecked("checked");
												}
//												log.info("id====>"+id+",name===>"+name);
												commonPassenger.setId(id);
												commonPassenger.setName(name);
												cpList.add(commonPassenger);
											}
											map.put("cpDiv", 1);
											map.put("cpList", cpList);
											break;
										}
										synchronized (page) {
											try {
												page.wait(500);
											} catch (InterruptedException e) {
												// TODO Auto-generated catch block
												e.printStackTrace();
											}
											log.info("加载常用旅客信息......");
										}
									}
									
								}
								
								
								List<FlightPassenger> fpList = new ArrayList<FlightPassenger>();
								HtmlElement ulList = (HtmlElement) page.getElementById("passenger-list");
								Document doc1 = Jsoup.parse(ulList.asXml());
								Elements lis = doc1.select("li");
								for (int k = 0; k < lis.size(); k++) {
									FlightPassenger flightPassenger = new FlightPassenger();
									Element li = lis.get(k);
//									log.info(li.toString());
									flightPassenger.pType = li.attr("data-type");
//									log.info("flightPassenger.pType==>" + flightPassenger.pType);
									flightPassenger.name1 = li.select("input[name=pName1]").first().val();
//									log.info("name1====>" + flightPassenger.name1);
									flightPassenger.name2 = li.select("input[name=pName2]").first().val();
//									log.info("name2====>" + flightPassenger.name2);
									flightPassenger.pIdType = li.select("div.select-trigger").get(1).text();
//									log.info("flightPassenger.pIdType==>" + flightPassenger.pIdType);
									flightPassenger.idNO = li.select("input[name=pIdCard]").first().val();
//									log.info("idNo====>" + flightPassenger.idNO);

									if (li.select("input[name=pBirthday]").size() != 0) {
										flightPassenger.birthday = li.select("input[name=pBirthday]").first().val();
//										log.info("出生日期==>" + flightPassenger.birthday);
									}

									if (li.select("div.psgs-carryByName").size() != 0) {
										flightPassenger.takeName = li.select("div.psgs-carryByName").first().html();
//										log.info("婴儿携带者===>" + flightPassenger.takeName);
									}
									flightPassenger.liId = li.attr("id");
									log.info("flightPassenger.liId==>" + flightPassenger.liId);

									HtmlInput zhx = (HtmlInput) page.getBody().getElementsByAttribute("input", "value", "a").get(0);
									flightPassenger.ir0Check = zhx.isChecked();
									log.info("综合险check====>" + flightPassenger.ir0Check);

									flightPassenger.ir0Money = li.select("span.ins-cost").get(0).text();
									log.info("综合险金额===>" + flightPassenger.ir0Money);


									fpList.add(flightPassenger);
								}
								
								HtmlInput contact_nameInput = (HtmlInput) page.getElementById("contact_name");
								String contact_name = contact_nameInput.getAttribute("value");
								map.put("contact_name", contact_name);
								log.info("contact_name==>" + contact_name);
//								HtmlInput contact_moblieInput = (HtmlInput) page.getElementById("contact-moblie");
//								String contact_moblie = contact_moblieInput.getAttribute("mobile");
//								map.put("contact_moblie", contact_moblie);
//								log.info("contact_moblie==>" + contact_moblie);
//								HtmlInput emailInput = (HtmlInput) page.getElementById("email");
//								String email = emailInput.getAttribute("email");
//								map.put("email", email);
//								log.info("email==>" + email);
								
								internationalPassengerInformationStyle1Page.setLS(CS.SUCCESS);
								log.info(internationalPassengerInformationStyle1Page.getLS());
								map.put("filist", fiList);
								map.put("fplist", fpList);
								map.put("internationalFlightInfo", internationalFlightInfo);
								map.put("baoxian", "1");
								long t3 = System.currentTimeMillis();
								double chuliTime =  ((t3-t2)/1000.0);
								double totleTime = ((t3-t1)/1000.0);
								double nanhangTime = totleTime - chuliTime;
								log.info("南航官网用时："+nanhangTime+"s,无障碍处理用时："+chuliTime+"s,总用时："+totleTime+"s");
								
								map.put("Time", "南航官网用时："+nanhangTime+"s,无障碍处理用时："+chuliTime+"s,总用时："+totleTime+"s");
								return map;
							
							}
							
							synchronized (page) {
								try {
									page.wait(500);
									log.info("load div.style......");
								} catch (InterruptedException e) {
									// TODO Auto-generated catch block
									e.printStackTrace();
								}
							}
						}
						break;
					}
					
					
					synchronized (page) {
						try {
							page.wait(500);
							log.info("loading page......");
						} catch (InterruptedException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
					}
				}
				
//			}
			internationalPassengerInformationStyle1Page.setLS(CS.TIMEOUT);
			log.info(internationalPassengerInformationStyle1Page.getLS());
		}
		return null;
	}

	
	/**
	 * 样式一变更舱位
	 */
	@Override
	public Map<String, Object> changeCw(String href , HttpSession session) {
		scl.aaaa = null;
		scl.change3 = null;
		Map<String, Object> map = new HashMap<String, Object>();
		List<FlightInternational> flights = new ArrayList<FlightInternational>();
		HtmlPage page = internationalFlightQuery.getHtmlPage();
		href = "#"+href;
		System.out.println("href===>"+href);
		List<HtmlElement> as = page.getBody().getElementsByAttribute("a", "href", href);
		if(as.size() != 0) {
			HtmlAnchor a = (HtmlAnchor) as.get(0);
			HtmlListItem li = (HtmlListItem) a.getParentNode();
			String liClass = li.getAttribute("class");
			System.out.println("liClass===>"+liClass);
			clickHandler(a);
			
			for (int i = 0; i <timeoutmax; i++) {
				if("" != null) {
					try {
						Thread.sleep(1000);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
						
					HtmlDivision div = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "sh-trip-body").get(0);
					Document document = Jsoup.parse(div.asXml());
					Elements elements = document.select("div.item");
					
					for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
						Element element = (Element) iterator.next();
						FlightInternational fi = new FlightInternational();
						
						// 起飞时间
						fi.qf_time = element.select("div.sh-intro li strong").get(0).text().trim();
						// 起飞城市
						fi.qf_city = element.select("div.sh-intro li strong").get(0).parent().ownText().trim();
						// 到达时间
						fi.dd_time = element.select("div.sh-intro li strong").get(1).text().trim();
						// 到达城市
						fi.dd_city = element.select("div.sh-intro li strong").get(1).parent().ownText().trim();
						// 航班号
						fi.hbh = element.select("div.caption").get(0).text().trim();
						// 飞机型号
//							f.jx = element.select("div.sp-trip-duration").get(0).text().trim();
						
						Element item1 = element.select("div.sh-cabins").get(0);
						if (item1 != null) {
							Element doc = item1;
							Elements els = doc.select("div."+liClass+"  span.sh-cab-name");
							if (!els.isEmpty()) {
								fi.cw = els.get(0).html();
							}
						}

						Elements item2s = element.select("."+liClass+"  div.price");
						System.out.println("item2s.size()===>"+item2s.size());
						if(item2s.size() != 0) {
							Element item2 = item2s.get(0);
							if (item2 != null) {
								Element doc = item2;
								Elements els = doc.select("strong");
								if (!els.isEmpty()) {
									fi.price = els.get(0).text().trim();
									System.out.println("fi.price====>"+fi.price);
								}
								fi.shouqing = "0";
							}
						}else {
							fi.shouqing = "1";
						}
						

						Element item3 = element.select("div.sh-cabins a.j-choose").get(0);
						if (item3 != null) {
							fi.yd_id = item3.attr("id").trim();
						}
						
						Element item4 = element.select("a.j-detail").get(0);
						if (item4 != null) {
							fi.xq_href = item4.attr("href");
						}
						flights.add(fi);
					}
					String userName = (String) session.getAttribute(Csair.USERNAME);
					map.put("userName", userName);
					map.put("flights", flights);
					map.put("mark", "1");
					return map;
				
				}
				synchronized (page) {
					try {
						page.wait(2000);
						log.info("加载国际航班查询页changeCw......");
					} catch (InterruptedException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				}
			}
		}
		System.out.println("加载超时！~~~~~~~~~~~");
//		System.out.println(page.asXml());
		return null;
	}
	
	/**
	 * 样式一变更舱位WF
	 */
	@Override
	public Map<String, Object> changeCwWF(String href, HttpSession session) {
		scl.aaaa = null;
		scl.change3 = null;
		
		Map<String, Object> map = new HashMap<String, Object>();
		List<FlightInternational> flights = new ArrayList<FlightInternational>();
		HtmlPage page = internationalFlightQuery2.getHtmlPage();
		href = "#"+href;
		System.out.println("href===>"+href);
		List<HtmlElement> as = page.getBody().getElementsByAttribute("a", "href", href);
		if(as.size() != 0) {
			HtmlAnchor a = (HtmlAnchor) as.get(0);
			a.focus();
			System.out.println(a.asXml());
			HtmlListItem li = (HtmlListItem) a.getParentNode();
			String liClass = li.getAttribute("class");
			System.out.println("liClass===>"+liClass);
			clickHandler(a);
			for (int i = 0; i <timeoutmax; i++) {
				if("" != null) {
					try {
						Thread.sleep(1000);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
						
					HtmlDivision div = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "sh-trip-body").get(0);
					Document document = Jsoup.parse(div.asXml());
					Elements elements = document.select("div.item");
					
					for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
						Element element = (Element) iterator.next();
						FlightInternational fi = new FlightInternational();
						
						// 起飞时间
						fi.qf_time = element.select("div.sh-intro li strong").get(0).text().trim();
						// 起飞城市
						fi.qf_city = element.select("div.sh-intro li strong").get(0).parent().ownText().trim();
						// 到达时间
						fi.dd_time = element.select("div.sh-intro li strong").get(1).text().trim();
						// 到达城市
						fi.dd_city = element.select("div.sh-intro li strong").get(1).parent().ownText().trim();
						// 航班号
						fi.hbh = element.select("div.caption").get(0).text().trim();
						// 飞机型号
//							f.jx = element.select("div.sp-trip-duration").get(0).text().trim();
						
						Element item1 = element.select("div.sh-cabins").get(0);
						if (item1 != null) {
							Element doc = item1;
							Elements els = doc.select("div."+liClass+"  span.sh-cab-name");
							if (!els.isEmpty()) {
								fi.cw = els.get(0).html();
							}
						}

						Elements item2s = element.select("."+liClass+"  div.price");
						System.out.println("item2s.size()===>"+item2s.size());
						if(item2s.size() != 0) {
							Element item2 = item2s.get(0);
							if (item2 != null) {
								Element doc = item2;
								Elements els = doc.select("strong");
								if (!els.isEmpty()) {
									fi.price = els.get(0).text().trim();
									System.out.println("fi.price====>"+fi.price);
								}
								fi.shouqing = "0";
							}
						}else {
							fi.shouqing = "1";
						}
						

						Element item3 = element.select("div.sh-cabins a.j-choose").get(0);
						if (item3 != null) {
							fi.yd_id = item3.attr("id").trim();
						}
						
						Element item4 = element.select("a.j-detail").get(0);
						if (item4 != null) {
							fi.xq_href = item4.attr("href");
						}
						flights.add(fi);
					}
					String userName = (String) session.getAttribute(Csair.USERNAME);
					map.put("userName", userName);
					map.put("flights", flights);
					map.put("mark", "1");
					return map;
				
				}
				synchronized (page) {
					try {
						page.wait(2000);
						log.info("加载国际航班查询页changeCwWF......");
					} catch (InterruptedException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				}
			}
		}
		System.out.println("加载超时！~~~~~~~~~~~");
		System.out.println(page.asXml());
		return null;
	}
	

	/**
	 * 往返国际航班查询日历
	 * @param id
	 * @param cf
	 * @param dd
	 * @param year
	 * @param month
	 * @param day
	 * @param year2
	 * @param month2
	 * @param day2
	 * @return
	 */
	public Map<String, Object> internationalFlightQueryExWF(String week, String c1, String c2, String year, String month,
			String day, String year2, String month2, String day2) {
		scl.internationalClickRl = null;
		Map<String, Object> map = new HashMap<String, Object>();
		List<FlightInternational> flights = new ArrayList<FlightInternational>();
		HtmlPage page = internationalFlightQuery2.getHtmlPage();
		HtmlElement he = page.getFirstByXPath("//li[@data-date='" + week + "']");
		clickHandler(he);
		for (int j = 0; j <= timeoutmax; j++) {
			if(scl.internationalClickRl != null) {
				try {
					Thread.sleep(500);
				} catch (InterruptedException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				}
				//未查询到航班提示
				HtmlDivision alert_error = page.getFirstByXPath("//div[@class='error-info']");
				if (alert_error != null) {
					map.put("cf", c1);
					map.put("dd", c2);
					map.put("year", year);
					map.put("month", month);
					map.put("day", day);
					map.put("year2", year2);
					map.put("month2", month2);
					map.put("day2", day2);

					HtmlDivision qc = page.getFirstByXPath("//div[@class='cities']");
					HtmlDivision rq = page.getFirstByXPath("//div[@class='date']");
					
					map.put("qc", qc.asText());// 全程
					map.put("rq", rq.asText());// 日期

					HtmlDivision lk = page.getFirstByXPath("//div[@class='psgs']");
					Document lkdoc = Jsoup.parse(lk.asXml());
					Elements lkelments = lkdoc.select("span");
					String adult = lkelments.get(0).text();
					String child = lkelments.get(1).text();
					String baby = lkelments.get(2).text();
					map.put("adult", adult);
					map.put("child", child);
					map.put("baby", baby);
					
					if(alert_error != null){
						map.put("noflight", alert_error.asText());
					}
					return map;
				}
				
				//页面的可能展示样式1
				HtmlDivision sh_trip_itemDiv = (HtmlDivision) page.getElementById("sh-trip-item-0-0");
				if(sh_trip_itemDiv != null) {
					map.put("cf", c1);
					map.put("dd", c2);
					map.put("year", year);
					map.put("month", month);
					map.put("day", day);
					map.put("year2", year2);
					map.put("month2", month2);
					map.put("day2", day2);

					HtmlDivision qc = page.getFirstByXPath("//div[@class='cities']");
					HtmlDivision rq = page.getFirstByXPath("//div[@class='date']");
					
					map.put("qc", qc.asText());// 全程
					map.put("rq", rq.asText());// 日期

					HtmlDivision lk = page.getFirstByXPath("//div[@class='psgs']");
					Document lkdoc = Jsoup.parse(lk.asXml());
					Elements lkelments = lkdoc.select("span");
					String adult = lkelments.get(0).text();
					String child = lkelments.get(1).text();
					String baby = lkelments.get(2).text();
					map.put("adult", adult);
					map.put("child", child);
					map.put("baby", baby);
					
					ArrayList<Cab> list = new ArrayList<Cab>();
					HtmlDivision cabinTab = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "sh-cabin-tab").get(0);
					DomNodeList<HtmlElement> cabinTabLis = cabinTab.getElementsByTagName("li");
					for (int j1 = 0; j1 < cabinTabLis.size(); j1++) {
						Cab cab = new Cab();
						HtmlListItem cabinTabLi = (HtmlListItem) cabinTabLis.get(j1);
						HtmlAnchor cabinTabLiA = (HtmlAnchor) cabinTabLi.getElementsByTagName("a").get(0);
						String cabinTabLiAHref = cabinTabLiA.getAttribute("href");
						String cabinTabLiACab = cabinTabLiA.asText();
						cab.setHref(cabinTabLiAHref);
						cab.setCab(cabinTabLiACab);
						list.add(cab);
					}
					map.put("list", list);
					
					HtmlDivision div = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "sh-list-view z-cab-ctt-0").get(0);
					Document document = Jsoup.parse(div.asXml());
					Elements elements = document.select("div.item");
					
					for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
						Element element = (Element) iterator.next();
						FlightInternational fi = new FlightInternational();
						
						// 起飞时间
						fi.qf_time = element.select("div.sh-intro li strong").get(0).text().trim();
						// 起飞城市
						fi.qf_city = element.select("div.sh-intro li strong").get(0).parent().ownText().trim();
						// 到达时间
						fi.dd_time = element.select("div.sh-intro li strong").get(1).text().trim();
						// 到达城市
						fi.dd_city = element.select("div.sh-intro li strong").get(1).parent().ownText().trim();
						// 航班号
						fi.hbh = element.select("div.caption").get(0).text().trim();
						// 飞机型号
//						f.jx = element.select("div.sp-trip-duration").get(0).text().trim();
						
						Element item1 = element.select("div.sh-cabins").get(0);
						if (item1 != null) {
							Element doc = item1;
							Elements els = doc.select("div.cab-0  span.sh-cab-name");
							if (!els.isEmpty()) {
								fi.cw = els.get(0).html();
							}
						}

						Elements item2s = element.select(".cab-0  div.price");
						if(item2s.size() != 0) {
							Element item2 = item2s.get(0);
							if (item2 != null) {
								Element doc = item2;
								Elements els = doc.select("strong");
								if (!els.isEmpty()) {
									fi.price = els.get(0).text().trim();
									System.out.println("fi.price====>"+fi.price);
								}
								fi.shouqing = "0";
							}
						}else {
							fi.shouqing = "1";
						}
						

						Element item3 = element.select("div.sh-cabins a.j-choose").get(0);
						if (item3 != null) {
							fi.yd_id = item3.attr("id").trim();
						}
						
						Element item4 = element.select("a.j-detail").get(0);
						if (item4 != null) {
							fi.xq_href = item4.attr("href");
						}
						flights.add(fi);
					}
					map.put("flights", flights);
					map.put("mark", "1");
					
					for (int j1 = 0; j1 <= timeoutmax; j1++) {
						HtmlDivision rls = page.getFirstByXPath("//div[@class='date-bar']");
						List<Kalendar> kalendars = new ArrayList<Kalendar>();
						if (rls != null) {
							Document document1 = Jsoup.parse(rls.asXml());
							Elements elements1 = document1.select("ul li");
							for (Iterator<Element> iterator = elements1.iterator(); iterator.hasNext();) {
								Element li = (Element) iterator.next();
								Kalendar k = new Kalendar();
								k.id = li.attr("data-date").trim();
//								log.info("cls:" + k.id);
								String cls = li.attr("class");
								System.out.println(cls);
								if (cls.trim().contains("current")) {
									k.current = "current";
								}else {
									k.current = "";
								}
								k.week = li.select("div.cell  strong").get(0).ownText();
								k.date = li.select("div.cell").get(0).ownText();
								k.price = li.select("div.chart  b").get(0).ownText();
//								log.info(k);
								kalendars.add(k);
							}
							map.put("kalendars", kalendars);
							break;
						}
						synchronized (page) {
							try {
								page.wait(waittime);
							} catch (InterruptedException e) {
								e.printStackTrace();
							}
						}
					}
					return map;
				}
				
				//页面可能展示的样式2
				List<HtmlElement> sp_sol_overviews = page.getBody().getElementsByAttribute("div", "class", "sp-sol-overview");
				if(sp_sol_overviews.size() != 0) {
					map.put("cf", c1);
					map.put("dd", c2);
					map.put("year", year);
					map.put("month", month);
					map.put("day", day);
					map.put("year2", year2);
					map.put("month2", month2);
					map.put("day2", day2);
					map.put("week", "none");

					String qc = page.getBody().getElementsByAttribute("h3", "class", "sp-trip-title").get(0).asText();
					qc = qc.substring(0, qc.indexOf("20")-1);
					HtmlDivision rq = page.getFirstByXPath("//div[@class='sp-trip-dates line-1']");
					
					map.put("qc", qc);// 全程
					map.put("rq", rq.asText());// 日期

					List<HtmlElement> lkelments = page.getBody().getElementsByAttribute("span", "class", "sp-trip-psg");
					String adult = lkelments.get(0).asText();
					String child = lkelments.get(1).asText();
					String baby = lkelments.get(2).asText();
					map.put("adult", adult);
					map.put("child", child);
					map.put("baby", baby);
					
					HtmlDivision div = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "sp-result").get(0);
					Document document = Jsoup.parse(div.asXml());
					Elements elements = document.select("div.sp-solution");
					for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
						Element element = (Element) iterator.next();
						FlightInternational fi = new FlightInternational();
						
						// 起飞时间
						fi.qf_time = element.select("div.dep strong").get(0).text().trim();
						// 起飞城市
						fi.qf_city = element.select("div.dep").get(0).ownText().trim();
						// 到达时间
						fi.dd_time = element.select("div.arr strong").get(0).text().trim();
						// 到达城市
						fi.dd_city = element.select("div.arr").get(0).ownText().trim();
						// 航班号
						fi.hbh = element.select("div.sp-sol-slice-flight").get(0).text().trim();
						// 飞机型号
//						f.jx = element.select("div.sp-trip-duration").get(0).text().trim();
						
						Element item1 = element.select("ul.sp-sol-cell").get(0);
						if (item1 != null) {
							Element doc = item1;
							Elements els = doc.select("div.sp-sol-cell-slice");
							if (!els.isEmpty()) {
								fi.cw = els.get(0).html();
							}
						}

						Element item2 = element.select("li.price").get(0);
						if (item2 != null) {
							Element doc = item2;
							Elements els = doc.select("strong");
							if (!els.isEmpty()) {
								fi.price = els.get(0).text().trim();
							}

						}

						Element item3 = element.select("a.j-sol-book").get(0);
						if (item3 != null) {
							fi.yd_href = item3.attr("href");
						}
						
						Element item4 = element.select("a.sp-sol-expander").get(0);
						if (item4 != null) {
							fi.xq_href = item4.attr("href");
						}
						flights.add(fi);
					}
					map.put("flights", flights);
					map.put("mark", "2");
					return map;
				}
			}
			
			synchronized (page) {
				try {
					page.wait(2000);
					log.info("加载国际航班查询页......");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		return map;
	}
	/**
	 * 单程国际航班查询日历
	 * @param id
	 * @param cf
	 * @param dd
	 * @param year
	 * @param month
	 * @param day
	 * @param year2
	 * @param month2
	 * @param day2
	 * @return
	 */
	public Map<String, Object> internationalFlightQueryEx(String week, String c1, String c2, String year, String month,
			String day, String year2, String month2, String day2) {
		scl.internationalClickRl = null;
		Map<String, Object> map = new HashMap<String, Object>();
		List<FlightInternational> flights = new ArrayList<FlightInternational>();
		HtmlPage page = internationalFlightQuery.getHtmlPage();
		HtmlElement he = page.getFirstByXPath("//li[@data-date='" + week + "']");
		clickHandler(he);
		for (int j = 0; j <= timeoutmax; j++) {
			if(scl.internationalClickRl != null) {
				try {
					Thread.sleep(500);
				} catch (InterruptedException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				}
				//未查询到航班提示
				HtmlDivision alert_error = page.getFirstByXPath("//div[@class='error-info']");
				if (alert_error != null) {
					map.put("cf", c1);
					map.put("dd", c2);
					map.put("year", year);
					map.put("month", month);
					map.put("day", day);
					map.put("year2", year2);
					map.put("month2", month2);
					map.put("day2", day2);
					
					HtmlDivision qc = page.getFirstByXPath("//div[@class='cities']");
					HtmlDivision rq = page.getFirstByXPath("//div[@class='date']");
					
					map.put("qc", qc.asText());// 全程
					map.put("rq", rq.asText());// 日期
					
					HtmlDivision lk = page.getFirstByXPath("//div[@class='psgs']");
					Document lkdoc = Jsoup.parse(lk.asXml());
					Elements lkelments = lkdoc.select("span");
					String adult = lkelments.get(0).text();
					String child = lkelments.get(1).text();
					String baby = lkelments.get(2).text();
					map.put("adult", adult);
					map.put("child", child);
					map.put("baby", baby);
					
					if(alert_error != null){
						map.put("noflight", alert_error.asText());
					}
					return map;
				}
				
				//页面的可能展示样式1
				HtmlDivision sh_trip_itemDiv = (HtmlDivision) page.getElementById("sh-trip-item-0-0");
				if(sh_trip_itemDiv != null) {
					map.put("cf", c1);
					map.put("dd", c2);
					map.put("year", year);
					map.put("month", month);
					map.put("day", day);
					map.put("year2", year2);
					map.put("month2", month2);
					map.put("day2", day2);
					
					HtmlDivision qc = page.getFirstByXPath("//div[@class='cities']");
					HtmlDivision rq = page.getFirstByXPath("//div[@class='date']");
					
					map.put("qc", qc.asText());// 全程
					map.put("rq", rq.asText());// 日期
					
					HtmlDivision lk = page.getFirstByXPath("//div[@class='psgs']");
					Document lkdoc = Jsoup.parse(lk.asXml());
					Elements lkelments = lkdoc.select("span");
					String adult = lkelments.get(0).text();
					String child = lkelments.get(1).text();
					String baby = lkelments.get(2).text();
					map.put("adult", adult);
					map.put("child", child);
					map.put("baby", baby);
					
					ArrayList<Cab> list = new ArrayList<Cab>();
					HtmlDivision cabinTab = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "sh-cabin-tab").get(0);
					DomNodeList<HtmlElement> cabinTabLis = cabinTab.getElementsByTagName("li");
					for (int j1 = 0; j1 < cabinTabLis.size(); j1++) {
						Cab cab = new Cab();
						HtmlListItem cabinTabLi = (HtmlListItem) cabinTabLis.get(j1);
						HtmlAnchor cabinTabLiA = (HtmlAnchor) cabinTabLi.getElementsByTagName("a").get(0);
						String cabinTabLiAHref = cabinTabLiA.getAttribute("href");
						String cabinTabLiACab = cabinTabLiA.asText();
						cab.setHref(cabinTabLiAHref);
						cab.setCab(cabinTabLiACab);
						list.add(cab);
					}
					map.put("list", list);
					
					HtmlDivision div = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "sh-list-view z-cab-ctt-0").get(0);
					Document document = Jsoup.parse(div.asXml());
					Elements elements = document.select("div.item");
					
					for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
						Element element = (Element) iterator.next();
						FlightInternational fi = new FlightInternational();
						
						// 起飞时间
						fi.qf_time = element.select("div.sh-intro li strong").get(0).text().trim();
						// 起飞城市
						fi.qf_city = element.select("div.sh-intro li strong").get(0).parent().ownText().trim();
						// 到达时间
						fi.dd_time = element.select("div.sh-intro li strong").get(1).text().trim();
						// 到达城市
						fi.dd_city = element.select("div.sh-intro li strong").get(1).parent().ownText().trim();
						// 航班号
						fi.hbh = element.select("div.caption").get(0).text().trim();
						// 飞机型号
//						f.jx = element.select("div.sp-trip-duration").get(0).text().trim();
						
						Element item1 = element.select("div.sh-cabins").get(0);
						if (item1 != null) {
							Element doc = item1;
							Elements els = doc.select("div.cab-0  span.sh-cab-name");
							if (!els.isEmpty()) {
								fi.cw = els.get(0).html();
							}
						}
						
						Elements item2s = element.select(".cab-0  div.price");
						if(item2s.size() != 0) {
							Element item2 = item2s.get(0);
							if (item2 != null) {
								Element doc = item2;
								Elements els = doc.select("strong");
								if (!els.isEmpty()) {
									fi.price = els.get(0).text().trim();
									System.out.println("fi.price====>"+fi.price);
								}
								fi.shouqing = "0";
							}
						}else {
							fi.shouqing = "1";
						}
						
						
						Element item3 = element.select("div.sh-cabins a.j-choose").get(0);
						if (item3 != null) {
							fi.yd_id = item3.attr("id").trim();
						}
						
						Element item4 = element.select("a.j-detail").get(0);
						if (item4 != null) {
							fi.xq_href = item4.attr("href");
						}
						flights.add(fi);
					}
					map.put("flights", flights);
					map.put("mark", "1");
					
					for (int j1 = 0; j1 <= timeoutmax; j1++) {
						HtmlDivision rls = page.getFirstByXPath("//div[@class='date-bar']");
						List<Kalendar> kalendars = new ArrayList<Kalendar>();
						if (rls != null) {
							Document document1 = Jsoup.parse(rls.asXml());
							Elements elements1 = document1.select("ul li");
							for (Iterator<Element> iterator = elements1.iterator(); iterator.hasNext();) {
								Element li = (Element) iterator.next();
								Kalendar k = new Kalendar();
								k.id = li.attr("data-date").trim();
//								log.info("cls:" + k.id);
								String cls = li.attr("class");
								System.out.println(cls);
								if (cls.trim().contains("current")) {
									k.current = "current";
								}else {
									k.current = "";
								}
								k.week = li.select("div.cell  strong").get(0).ownText();
								k.date = li.select("div.cell").get(0).ownText();
								k.price = li.select("div.chart  b").get(0).ownText();
//								log.info(k);
								kalendars.add(k);
							}
							map.put("kalendars", kalendars);
							break;
						}
						synchronized (page) {
							try {
								page.wait(waittime);
							} catch (InterruptedException e) {
								e.printStackTrace();
							}
						}
					}
					return map;
				}
				
				//页面可能展示的样式2
				List<HtmlElement> sp_sol_overviews = page.getBody().getElementsByAttribute("div", "class", "sp-sol-overview");
				if(sp_sol_overviews.size() != 0) {
					map.put("cf", c1);
					map.put("dd", c2);
					map.put("year", year);
					map.put("month", month);
					map.put("day", day);
					map.put("year2", year2);
					map.put("month2", month2);
					map.put("day2", day2);
					map.put("week", "none");
					
					String qc = page.getBody().getElementsByAttribute("h3", "class", "sp-trip-title").get(0).asText();
					qc = qc.substring(0, qc.indexOf("20")-1);
					HtmlDivision rq = page.getFirstByXPath("//div[@class='sp-trip-dates line-1']");
					
					map.put("qc", qc);// 全程
					map.put("rq", rq.asText());// 日期
					
					List<HtmlElement> lkelments = page.getBody().getElementsByAttribute("span", "class", "sp-trip-psg");
					String adult = lkelments.get(0).asText();
					String child = lkelments.get(1).asText();
					String baby = lkelments.get(2).asText();
					map.put("adult", adult);
					map.put("child", child);
					map.put("baby", baby);
					
					HtmlDivision div = (HtmlDivision) page.getBody().getElementsByAttribute("div", "class", "sp-result").get(0);
					Document document = Jsoup.parse(div.asXml());
					Elements elements = document.select("div.sp-solution");
					for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
						Element element = (Element) iterator.next();
						FlightInternational fi = new FlightInternational();
						
						// 起飞时间
						fi.qf_time = element.select("div.dep strong").get(0).text().trim();
						// 起飞城市
						fi.qf_city = element.select("div.dep").get(0).ownText().trim();
						// 到达时间
						fi.dd_time = element.select("div.arr strong").get(0).text().trim();
						// 到达城市
						fi.dd_city = element.select("div.arr").get(0).ownText().trim();
						// 航班号
						fi.hbh = element.select("div.sp-sol-slice-flight").get(0).text().trim();
						// 飞机型号
//						f.jx = element.select("div.sp-trip-duration").get(0).text().trim();
						
						Element item1 = element.select("ul.sp-sol-cell").get(0);
						if (item1 != null) {
							Element doc = item1;
							Elements els = doc.select("div.sp-sol-cell-slice");
							if (!els.isEmpty()) {
								fi.cw = els.get(0).html();
							}
						}
						
						Element item2 = element.select("li.price").get(0);
						if (item2 != null) {
							Element doc = item2;
							Elements els = doc.select("strong");
							if (!els.isEmpty()) {
								fi.price = els.get(0).text().trim();
							}
							
						}
						
						Element item3 = element.select("a.j-sol-book").get(0);
						if (item3 != null) {
							fi.yd_href = item3.attr("href");
						}
						
						Element item4 = element.select("a.sp-sol-expander").get(0);
						if (item4 != null) {
							fi.xq_href = item4.attr("href");
						}
						flights.add(fi);
					}
					map.put("flights", flights);
					map.put("mark", "2");
					return map;
				}
			}
			
			synchronized (page) {
				try {
					page.wait(2000);
					log.info("加载国际航班查询页......");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		return map;
	}
	
	/**
	 * 国际航班样式一点击去程
	 */
	@Override
	public Map<String, Object> internationalChooseSend(String id,String cf, String dd, String year, String month, String day, String year2, String month2, String day2) {
		System.out.println("id=====>"+id);
		Map<String, Object> map = new HashMap<String, Object>();
		List<FlightInternational> flights = new ArrayList<FlightInternational>();
		HtmlPage page = internationalFlightQuery2.getHtmlPage();
		HtmlAnchor sendA = (HtmlAnchor) page.getElementById(id);
		clickHandler(sendA);
		for (int i = 0; i < timeoutmax; i++) {
			
			HtmlDivision item10 = (HtmlDivision) page.getElementById("sh-trip-item-1-0");
			if(item10 != null) {
				HtmlDivision div = page.getFirstByXPath("//div[@id='trip-summary']");
				Document doc = Jsoup.parse(div.asXml());
				Elements boxes = doc.select("div.sm-trip");
				List<InternationalFlightInfo> fiList = new ArrayList<InternationalFlightInfo>();
				for (int i1 = 0; i1 < boxes.size(); i1++) {
					InternationalFlightInfo internationalFlightInfo1 = new InternationalFlightInfo();
					List<FlightSummary> list = new ArrayList<FlightSummary>();
					Element tb = boxes.get(i1);
					String tbClass = tb.attr("class");
					if(!tbClass.contains("hide")) {
						internationalFlightInfo1.flight_name = tb.select(".sm-trip-prefix").get(0).text();
						Elements uls = tb.select("ul");
						for (int k = 0; k < uls.size(); k++) {
							FlightSummary flightSummary = new FlightSummary();
							Element tr = uls.get(k);
							Elements lis = tr.select("li");
							Element li0 = lis.get(0);
							flightSummary.qf_city = li0.select("strong").get(0).ownText();// 起飞城市
							System.out.println("flightSummary.qf_city===>"+flightSummary.qf_city);
							flightSummary.qf_time = li0.select("span.sm-ep-time").text();// 起飞时间time
							System.out.println("flightSummary.qf_time===>"+flightSummary.qf_time);
							flightSummary.qf_date = li0.ownText();// 起飞日期
							System.out.println("flightSummary.qf_date===>"+flightSummary.qf_date);
							Element li1 = lis.get(1);
							flightSummary.hbh = li1.select("div.btm").text();
							System.out.println("flightSummary.hbh===>"+flightSummary.hbh);
							Element li2 = lis.get(2);
							flightSummary.dd_city = li2.select("strong").get(0).ownText();// 到达城市
							System.out.println("flightSummary.dd_city===>"+flightSummary.dd_city);
							flightSummary.dd_time = li2.select("span.sm-ep-time").text();// 到达时间
							System.out.println("flightSummary.dd_time===>"+flightSummary.dd_time);
							flightSummary.dd_date = li2.ownText();// 到达时间
							System.out.println("flightSummary.dd_date===>"+flightSummary.dd_date);
							Element li3 = lis.get(3);
							flightSummary.cx = li3.text();
							System.out.println("flightSummary.cx===>"+flightSummary.cx);
							list.add(flightSummary);
						}
						internationalFlightInfo1.setFlightSummaryList(list);
						fiList.add(internationalFlightInfo1);
					}
				}
				map.put("filist", fiList);
				map.put("display0", "block");
				
				InternationalFlightInfo internationalFlightInfo = new InternationalFlightInfo();
				Elements subTbs = doc.select("div.detail-price table tr");
				for (int k = 1; k < subTbs.size(); k++) {
					Element tr = subTbs.get(k);
					internationalFlightInfo.infos[k - 1].lk = tr.select("td").get(0).text();
					internationalFlightInfo.infos[k - 1].pj = tr.select("td").get(1).text();
					internationalFlightInfo.infos[k - 1].ryf = tr.select("td").get(2).text();
				}
				internationalFlightInfo.total = doc.select("strong#total_pay").text();
				System.out.println("internationalFlightInfo.total====>"+internationalFlightInfo.total);
				map.put("internationalFlightInfo", internationalFlightInfo);
				
				map.put("cf", cf);
				map.put("dd", dd);
				map.put("year", year);
				map.put("month", month);
				map.put("day", day);
				map.put("year2", year2);
				map.put("month2", month2);
				map.put("day2", day2);

				HtmlDivision tripDiv = (HtmlDivision) page.getElementById("trip-1");
				HtmlDivision qc = tripDiv.getFirstByXPath("//div[@class='cities']");
				HtmlDivision rq = tripDiv.getFirstByXPath("//div[@class='date']");
				
				map.put("qc", qc.asText());// 全程
				map.put("rq", rq.asText());// 日期

				HtmlDivision lk = tripDiv.getFirstByXPath("//div[@class='psgs']");
				Document lkdoc = Jsoup.parse(lk.asXml());
				Elements lkelments = lkdoc.select("span");
				String adult = lkelments.get(0).text();
				String child = lkelments.get(1).text();
				String baby = lkelments.get(2).text();
				map.put("adult", adult);
				map.put("child", child);
				map.put("baby", baby);
				
				ArrayList<Cab> list = new ArrayList<Cab>();
				HtmlDivision cabinTab = (HtmlDivision) tripDiv.getElementsByAttribute("div", "class", "sh-cabin-tab").get(0);
				DomNodeList<HtmlElement> cabinTabLis = cabinTab.getElementsByTagName("li");
				for (int j = 0; j < cabinTabLis.size(); j++) {
					Cab cab = new Cab();
					HtmlListItem cabinTabLi = (HtmlListItem) cabinTabLis.get(j);
					HtmlAnchor cabinTabLiA = (HtmlAnchor) cabinTabLi.getElementsByTagName("a").get(0);
					String cabinTabLiAHref = cabinTabLiA.getAttribute("href");
					String cabinTabLiACab = cabinTabLiA.asText();
					cab.setHref(cabinTabLiAHref);
					cab.setCab(cabinTabLiACab);
					list.add(cab);
				}
				map.put("list", list);
				
				HtmlDivision div1 = (HtmlDivision) tripDiv.getElementsByAttribute("div", "class", "sh-list-view z-cab-ctt-0").get(0);
				Document document = Jsoup.parse(div1.asXml());
				Elements elements = document.select("div.item");
				
				for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
					Element element = (Element) iterator.next();
					FlightInternational fi = new FlightInternational();
					
					// 起飞时间
					fi.qf_time = element.select("div.sh-intro li strong").get(0).text().trim();
					// 起飞城市
					fi.qf_city = element.select("div.sh-intro li strong").get(0).parent().ownText().trim();
					// 到达时间
					fi.dd_time = element.select("div.sh-intro li strong").get(1).text().trim();
					// 到达城市
					fi.dd_city = element.select("div.sh-intro li strong").get(1).parent().ownText().trim();
					// 航班号
					fi.hbh = element.select("div.caption").get(0).text().trim();
					// 飞机型号
//					f.jx = element.select("div.sp-trip-duration").get(0).text().trim();
					
					Element item1 = element.select("div.sh-cabins").get(0);
					if (item1 != null) {
						Element doc1 = item1;
						Elements els = doc1.select("div.cab-0  span.sh-cab-name");
						if (!els.isEmpty()) {
							fi.cw = els.get(0).html();
						}
					}
					
					Elements item2s = element.select(".cab-0  div.price");
					if(item2s.size() != 0) {
						Element item2 = item2s.get(0);
						if (item2 != null) {
							Element doc1 = item2;
							Elements els = doc1.select("strong");
							if (!els.isEmpty()) {
								fi.price = els.get(0).text().trim();
								System.out.println("fi.price====>"+fi.price);
							}
							fi.shouqing = "0";
						}
					}else {
						fi.shouqing = "1";
					}
					

					Element item3 = element.select("div.sh-cabins a.j-choose").get(0);
					if (item3 != null) {
						fi.yd_id = item3.attr("id").trim();
					}
					
					Element item4 = element.select("a.j-detail").get(0);
					if (item4 != null) {
						fi.xq_href = item4.attr("href");
					}
					flights.add(fi);
				}
				map.put("flights", flights);
				map.put("mark", "1");
				
				for (int j = 0; j <= timeoutmax; j++) {
					HtmlUnorderedList rls = tripDiv.getFirstByXPath("//ul[@id='dateBar-cells-1']");
					System.out.println("==============================================");
					System.out.println(rls.asXml());
					System.out.println("==============================================");
					List<Kalendar> kalendars = new ArrayList<Kalendar>();
					if (rls != null) {
						Document document1 = Jsoup.parse(rls.asXml());
						Elements elements1 = document1.select("li");
						for (Iterator<Element> iterator = elements1.iterator(); iterator.hasNext();) {
							Element li = (Element) iterator.next();
							Kalendar k = new Kalendar();
							k.id = li.attr("data-date").trim();
//							log.info("cls:" + k.id);
							String cls = li.attr("class");
							if (cls != null && cls.trim().contains("current")) {
								k.current = "current";
							}
							k.week = li.select("div.cell  strong").get(0).ownText();
							k.date = li.select("div.cell").get(0).ownText();
							k.price = li.select("div.chart  b").get(0).ownText();
//							log.info(k);
							kalendars.add(k);
						}
						map.put("kalendars", kalendars);
						break;
					}
				}
				
				return map;
			}
			synchronized (page) {
				try {
					page.wait(1000);
					log.info("加载去程页面.......");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		
		return map;
	}

	/**
	 * 往返国际航班查询点击去程后航班日历
	 * @param id
	 * @param cf
	 * @param dd
	 * @param year
	 * @param month
	 * @param day
	 * @param year2
	 * @param month2
	 * @param day2
	 * @return
	 */
	public Map<String, Object> internationalWeekSendWF(String id, String cf, String dd, String year, String month,
			String day, String year2, String month2, String day2) {
		scl.internationalClickRl = null;
		Map<String, Object> map = new HashMap<String, Object>();
		List<FlightInternational> flights = new ArrayList<FlightInternational>();
		HtmlPage page = internationalFlightQuery2.getHtmlPage();
		HtmlElement he = page.getFirstByXPath("//li[@data-date='" + id + "']");
		clickHandler(he);
		for (int j = 0; j <= timeoutmax; j++) {
			if(scl.internationalClickRl != null) {
				try {
					Thread.sleep(500);
				} catch (InterruptedException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				}
				//未查询到航班提示
				HtmlDivision alert_error = page.getFirstByXPath("//div[@class='error-info']");
				if (alert_error != null) {
					map.put("cf", cf);
					map.put("dd", dd);
					map.put("year", year);
					map.put("month", month);
					map.put("day", day);
					map.put("year2", year2);
					map.put("month2", month2);
					map.put("day2", day2);

					HtmlDivision qc = page.getFirstByXPath("//div[@class='cities']");
					HtmlDivision rq = page.getFirstByXPath("//div[@class='date']");
					
					map.put("qc", qc.asText());// 全程
					map.put("rq", rq.asText());// 日期

					HtmlDivision lk = page.getFirstByXPath("//div[@class='psgs']");
					Document lkdoc = Jsoup.parse(lk.asXml());
					Elements lkelments = lkdoc.select("span");
					String adult = lkelments.get(0).text();
					String child = lkelments.get(1).text();
					String baby = lkelments.get(2).text();
					map.put("adult", adult);
					map.put("child", child);
					map.put("baby", baby);
					
					if(alert_error != null){
						map.put("noflight", alert_error.asText());
					}
					return map;
				}
				
				//页面的可能展示样式1
				HtmlDivision item10 = (HtmlDivision) page.getElementById("sh-trip-item-1-0");
				if(item10 != null) {
					HtmlDivision div = page.getFirstByXPath("//div[@id='trip-summary']");
					Document doc = Jsoup.parse(div.asXml());
					Elements boxes = doc.select("div.sm-trip");
					List<InternationalFlightInfo> fiList = new ArrayList<InternationalFlightInfo>();
					for (int i1 = 0; i1 < boxes.size(); i1++) {
						InternationalFlightInfo internationalFlightInfo1 = new InternationalFlightInfo();
						List<FlightSummary> list = new ArrayList<FlightSummary>();
						Element tb = boxes.get(i1);
						String tbClass = tb.attr("class");
						if(!tbClass.contains("hide")) {
							internationalFlightInfo1.flight_name = tb.select(".sm-trip-prefix").get(0).text();
							Elements uls = tb.select("ul");
							for (int k = 0; k < uls.size(); k++) {
								FlightSummary flightSummary = new FlightSummary();
								Element tr = uls.get(k);
								Elements lis = tr.select("li");
								Element li0 = lis.get(0);
								flightSummary.qf_city = li0.select("strong").get(0).ownText();// 起飞城市
								System.out.println("flightSummary.qf_city===>"+flightSummary.qf_city);
								flightSummary.qf_time = li0.select("span.sm-ep-time").text();// 起飞时间time
								System.out.println("flightSummary.qf_time===>"+flightSummary.qf_time);
								flightSummary.qf_date = li0.ownText();// 起飞日期
								System.out.println("flightSummary.qf_date===>"+flightSummary.qf_date);
								Element li1 = lis.get(1);
								flightSummary.hbh = li1.select("div.btm").text();
								System.out.println("flightSummary.hbh===>"+flightSummary.hbh);
								Element li2 = lis.get(2);
								flightSummary.dd_city = li2.select("strong").get(0).ownText();// 到达城市
								System.out.println("flightSummary.dd_city===>"+flightSummary.dd_city);
								flightSummary.dd_time = li2.select("span.sm-ep-time").text();// 到达时间
								System.out.println("flightSummary.dd_time===>"+flightSummary.dd_time);
								flightSummary.dd_date = li2.ownText();// 到达时间
								System.out.println("flightSummary.dd_date===>"+flightSummary.dd_date);
								Element li3 = lis.get(3);
								flightSummary.cx = li3.text();
								System.out.println("flightSummary.cx===>"+flightSummary.cx);
								list.add(flightSummary);
							}
							internationalFlightInfo1.setFlightSummaryList(list);
							fiList.add(internationalFlightInfo1);
						}
					}
					map.put("filist", fiList);
					map.put("display0", "block");
					
					InternationalFlightInfo internationalFlightInfo = new InternationalFlightInfo();
					Elements subTbs = doc.select("div.detail-price table tr");
					for (int k = 1; k < subTbs.size(); k++) {
						Element tr = subTbs.get(k);
						internationalFlightInfo.infos[k - 1].lk = tr.select("td").get(0).text();
						internationalFlightInfo.infos[k - 1].pj = tr.select("td").get(1).text();
						internationalFlightInfo.infos[k - 1].ryf = tr.select("td").get(2).text();
					}
					internationalFlightInfo.total = doc.select("strong#total_pay").text();
					System.out.println("internationalFlightInfo.total====>"+internationalFlightInfo.total);
					map.put("internationalFlightInfo", internationalFlightInfo);
					
					map.put("cf", cf);
					map.put("dd", dd);
					map.put("year", year);
					map.put("month", month);
					map.put("day", day);
					map.put("year2", year2);
					map.put("month2", month2);
					map.put("day2", day2);

					HtmlDivision tripDiv = (HtmlDivision) page.getElementById("trip-1");
					HtmlDivision qc = tripDiv.getFirstByXPath("//div[@class='cities']");
					HtmlDivision rq = tripDiv.getFirstByXPath("//div[@class='date']");
					
					map.put("qc", qc.asText());// 全程
					map.put("rq", rq.asText());// 日期

					HtmlDivision lk = tripDiv.getFirstByXPath("//div[@class='psgs']");
					Document lkdoc = Jsoup.parse(lk.asXml());
					Elements lkelments = lkdoc.select("span");
					String adult = lkelments.get(0).text();
					String child = lkelments.get(1).text();
					String baby = lkelments.get(2).text();
					map.put("adult", adult);
					map.put("child", child);
					map.put("baby", baby);
					
					ArrayList<Cab> list = new ArrayList<Cab>();
					HtmlDivision cabinTab = (HtmlDivision) tripDiv.getElementsByAttribute("div", "class", "sh-cabin-tab").get(0);
					DomNodeList<HtmlElement> cabinTabLis = cabinTab.getElementsByTagName("li");
					for (int j1 = 0; j1 < cabinTabLis.size(); j1++) {
						Cab cab = new Cab();
						HtmlListItem cabinTabLi = (HtmlListItem) cabinTabLis.get(j1);
						HtmlAnchor cabinTabLiA = (HtmlAnchor) cabinTabLi.getElementsByTagName("a").get(0);
						String cabinTabLiAHref = cabinTabLiA.getAttribute("href");
						String cabinTabLiACab = cabinTabLiA.asText();
						cab.setHref(cabinTabLiAHref);
						cab.setCab(cabinTabLiACab);
						list.add(cab);
					}
					map.put("list", list);
					
					HtmlDivision div1 = (HtmlDivision) tripDiv.getElementsByAttribute("div", "class", "sh-list-view z-cab-ctt-0").get(0);
					Document document = Jsoup.parse(div1.asXml());
					Elements elements = document.select("div.item");
					
					for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
						Element element = (Element) iterator.next();
						FlightInternational fi = new FlightInternational();
						
						// 起飞时间
						fi.qf_time = element.select("div.sh-intro li strong").get(0).text().trim();
						// 起飞城市
						fi.qf_city = element.select("div.sh-intro li strong").get(0).parent().ownText().trim();
						// 到达时间
						fi.dd_time = element.select("div.sh-intro li strong").get(1).text().trim();
						// 到达城市
						fi.dd_city = element.select("div.sh-intro li strong").get(1).parent().ownText().trim();
						// 航班号
						fi.hbh = element.select("div.caption").get(0).text().trim();
						// 飞机型号
//						f.jx = element.select("div.sp-trip-duration").get(0).text().trim();
						
						Element item1 = element.select("div.sh-cabins").get(0);
						if (item1 != null) {
							Element doc1 = item1;
							Elements els = doc1.select("div.cab-0  span.sh-cab-name");
							if (!els.isEmpty()) {
								fi.cw = els.get(0).html();
							}
						}
						
						Elements item2s = element.select(".cab-0  div.price");
						if(item2s.size() != 0) {
							Element item2 = item2s.get(0);
							if (item2 != null) {
								Element doc1 = item2;
								Elements els = doc1.select("strong");
								if (!els.isEmpty()) {
									fi.price = els.get(0).text().trim();
									System.out.println("fi.price====>"+fi.price);
								}
								fi.shouqing = "0";
							}
						}else {
							fi.shouqing = "1";
						}
						

						Element item3 = element.select("div.sh-cabins a.j-choose").get(0);
						if (item3 != null) {
							fi.yd_id = item3.attr("id").trim();
						}
						
						Element item4 = element.select("a.j-detail").get(0);
						if (item4 != null) {
							fi.xq_href = item4.attr("href");
						}
						flights.add(fi);
					}
					map.put("flights", flights);
					map.put("mark", "1");
					
					for (int j1 = 0; j1 <= timeoutmax; j1++) {
						HtmlUnorderedList rls = tripDiv.getFirstByXPath("//ul[@id='dateBar-cells-1']");
						System.out.println("==============================================");
						System.out.println(rls.asXml());
						System.out.println("==============================================");
						List<Kalendar> kalendars = new ArrayList<Kalendar>();
						if (rls != null) {
							Document document1 = Jsoup.parse(rls.asXml());
							Elements elements1 = document1.select("li");
							for (Iterator<Element> iterator = elements1.iterator(); iterator.hasNext();) {
								Element li = (Element) iterator.next();
								Kalendar k = new Kalendar();
								k.id = li.attr("data-date").trim();
//								log.info("cls:" + k.id);
								String cls = li.attr("class");
								if (cls != null && cls.trim().contains("current")) {
									k.current = "current";
								}
								k.week = li.select("div.cell  strong").get(0).ownText();
								k.date = li.select("div.cell").get(0).ownText();
								k.price = li.select("div.chart  b").get(0).ownText();
//								log.info(k);
								kalendars.add(k);
							}
							map.put("kalendars", kalendars);
							break;
						}
					}
					
					return map;
				}
				
			}
			
			synchronized (page) {
				try {
					page.wait(2000);
					log.info("加载往返国际航班查询点击去程后航班日历页面......");
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		return map;
	}
	
	/**
	 * 添加国际航班乘客填写内容
	 */
	@Override
	public CsairReturnValue internationalAddpassenger(List<InternationalPassenger> list) {
		CsairReturnValue returnValue = new CsairReturnValue();
		HtmlPage page = internationalPassengerInformationPage.getHtmlPage();

 		for (int i = 0; i < list.size(); i++) {
			InternationalPassenger p = list.get(i);
			HtmlInput psgName1Input = (HtmlInput)page.getBody().getElementsByAttribute("input", "name", "pName1").get(i);
			psgName1Input.setValueAttribute(p.getPsgName1());
			HtmlInput psgName2Input = (HtmlInput)page.getBody().getElementsByAttribute("input", "name", "pName2").get(i);
			psgName2Input.setValueAttribute(p.getPsgName2());

			HtmlInput pIdCardInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "name", "pIdCard").get(i);
			pIdCardInput.setValueAttribute(p.getpIdCard());
		}
		returnValue.setState(CS.SUCCESS);
		return returnValue;
	}

	/**
	 * 国际航班添加乘客
	 */
	@Override
	public Map<String, Object> internationalAddpassengerloadFilightInfo() {
		Map<String, Object> map = new HashMap<String, Object>();
		HtmlPage page = internationalPassengerInformationPage.getHtmlPage();
		HtmlButton addButton = page.getFirstByXPath("//button[@id='addNewPsg']");
		clickHandler(addButton);

		for (int j = 0; j <= 100; j++) {
			HtmlTable valid = page.getFirstByXPath("//table[@class='summary-sub']");
			if (valid != null) {
//				long t2 = System.currentTimeMillis();
				HtmlDivision div = page.getFirstByXPath("//div[@class='flight-summary-box']");
				Document doc = Jsoup.parse(div.asXml());
				Elements boxes = doc.select("div#flight-summary-box .singleFlightBox");
				List<InternationalFlightInfo> fiList = new ArrayList<InternationalFlightInfo>();
				for (int i1 = 0; i1 < boxes.size(); i1++) {
					InternationalFlightInfo internationalFlightInfo1 = new InternationalFlightInfo();
					List<FlightSummary> list = new ArrayList<FlightSummary>();
					Element tb = boxes.get(i1);
					internationalFlightInfo1.flight_name = tb.select(".flight-name").get(0).text();
					Elements trs = tb.select("tr");
					for (int k = 1; k < trs.size(); k++) {
						FlightSummary flightSummary = new FlightSummary();
						Element tr = trs.get(k);
						Elements tds = tr.select("td");
						Element td0 = tds.get(0);
						flightSummary.qf_city = td0.select("span.flight-city").get(0).ownText();// 起飞城市
						System.out.println("flightSummary.qf_city===>"+flightSummary.qf_city);
						flightSummary.qf_time = td0.select("span.marginLeft").text();// 起飞时间flight-date
						System.out.println("flightSummary.qf_time===>"+flightSummary.qf_time);
						flightSummary.qf_date = td0.select("span.flight-date").text();// 起飞时间
						System.out.println("flightSummary.qf_date===>"+flightSummary.qf_date);
						Element td1 = tds.get(1);
						flightSummary.hbh = td1.select("span").text();
						System.out.println("flightSummary.hbh===>"+flightSummary.hbh);
						Element td2 = tds.get(2);
						flightSummary.dd_city = td2.select("span.flight-city").get(0).ownText();// 到达城市
						System.out.println("flightSummary.dd_city===>"+flightSummary.dd_city);
						flightSummary.dd_time = td2.select("span.marginLeft").text();// 到达时间
						System.out.println("flightSummary.dd_time===>"+flightSummary.dd_time);
						flightSummary.dd_date = td2.select("span.flight-date").text();// 到达时间
						System.out.println("flightSummary.dd_date===>"+flightSummary.dd_date);
						Element td3 = tds.get(3);
						flightSummary.cx = td3.text();
						System.out.println("flightSummary.cx===>"+flightSummary.cx);
						list.add(flightSummary);
					}
					internationalFlightInfo1.setFlightSummaryList(list);
					fiList.add(internationalFlightInfo1);
				}
				// 概述完成
				InternationalFlightInfo internationalFlightInfo = new InternationalFlightInfo();
				Elements subTbs = doc.select("div#summary-sub-box table tr");
				for (int k = 1; k < subTbs.size(); k++) {
					Element tr = subTbs.get(k);
					internationalFlightInfo.infos[k - 1].lk = tr.select("td").get(0).text();
					internationalFlightInfo.infos[k - 1].pj = tr.select("td").get(1).text();
					internationalFlightInfo.infos[k - 1].ryf = tr.select("td").get(2).text();
				}
				internationalFlightInfo.total = doc.select("div#price-total span").text();
				System.out.println("internationalFlightInfo.total====>"+internationalFlightInfo.total);
				
				//常用旅客
//				map.put("cpDiv", 0);
//				HtmlDivision commonPassengerListDiv = (HtmlDivision) page.getElementById("common-passenger-list");
//				System.out.println("commonPassengerListDiv===>"+commonPassengerListDiv);
//				if(commonPassengerListDiv != null ) {
//					List<CommonPassenger> cpList = new ArrayList<CommonPassenger>();
//					for (int i1 = 0; i1 < timeoutmax; i1++) {
//						DomNodeList<HtmlElement> as = commonPassengerListDiv.getElementsByTagName("a");
////						log.info("as.size()===>"+as.size());
//						if(scl.getSvcEPassenger != null && as.size() != 0) {
//							for (int i11 = 0; i11 < as.size(); i11++) {
//								CommonPassenger commonPassenger = new CommonPassenger();
//								String id = as.get(i11).getAttribute("id");
//								String name = as.get(i11).asText();
//								String aclass = as.get(i11).getAttribute("class");
//								if(aclass.contains("used")) {
//									commonPassenger.setChecked("checked");
//								}
////								log.info("id====>"+id+",name===>"+name);
//								commonPassenger.setId(id);
//								commonPassenger.setName(name);
//								cpList.add(commonPassenger);
//							}
//							map.put("cpDiv", 1);
//							map.put("cpList", cpList);
//							break;
//						}
//						synchronized (page) {
//							try {
//								page.wait(500);
//							} catch (InterruptedException e) {
								// TODO Auto-generated catch block
//								e.printStackTrace();
//							}
//							log.info("加载常用旅客信息......");
//						}
//					}
//					
//				}
				
				
				List<FlightPassenger> fpList = new ArrayList<FlightPassenger>();
				HtmlElement ulList = (HtmlElement) page.getElementById("passenger-list");
				Document doc1 = Jsoup.parse(ulList.asXml());
				Elements lis = doc1.select("li");
				for (int k = 0; k < lis.size(); k++) {
					FlightPassenger flightPassenger = new FlightPassenger();
					Element li = lis.get(k);
//					log.info(li.toString());
					flightPassenger.pType = li.attr("data-type");
					log.info("flightPassenger.pType==>" + flightPassenger.pType);
					flightPassenger.name1 = li.select("input[name=pName1]").first().val();
//					log.info("name1====>" + flightPassenger.name1);
					flightPassenger.name2 = li.select("input[name=pName2]").first().val();
//					log.info("name2====>" + flightPassenger.name2);
					flightPassenger.pIdType = li.select("div.select-trigger").get(1).text();
//					log.info("flightPassenger.pIdType==>" + flightPassenger.pIdType);
					flightPassenger.idNO = li.select("input[name=pIdCard]").first().val();
//					log.info("idNo====>" + flightPassenger.idNO);

					if (li.select("input[name=pBirthday]").size() != 0) {
						flightPassenger.birthday = li.select("input[name=pBirthday]").first().val();
//						log.info("出生日期==>" + flightPassenger.birthday);
					}

					if (li.select("div.psgs-carryByName").size() != 0) {
						flightPassenger.takeName = li.select("div.psgs-carryByName").first().html();
//						log.info("婴儿携带者===>" + flightPassenger.takeName);
					}
					flightPassenger.liId = li.attr("id");
					log.info("flightPassenger.liId==>" + flightPassenger.liId);


					fpList.add(flightPassenger);
				}
				
				List<Country> countryList = new ArrayList<Country>();
				HtmlInput pNationalityInput = (HtmlInput) page.getBody().getElementsByAttribute("input", "name", "pNationality").get(0);
				pNationalityInput.focus();
				clickHandler(pNationalityInput);
				for (int k = 0; k < timeoutmax; k++) {
					HtmlDivision undefinedDiv = (HtmlDivision) page.getElementById("undefined-div");
					if(undefinedDiv != null) {
						DomNodeList<HtmlElement> undefinedDivLis = undefinedDiv.getElementsByTagName("li");
						for (int l = 0; l < undefinedDivLis.size(); l++) {
							Country country = new Country();
							HtmlListItem li = (HtmlListItem) undefinedDivLis.get(l);
							HtmlAnchor a = (HtmlAnchor) li.getElementsByTagName("a").get(0);
							String href = a.getAttribute("href");
							String countryName = a.asText();
							country.setCountryHref(href);
							country.setCountryName(countryName);
							countryList.add(country);
						}
						map.put("countryList", countryList);
						break;
					}
					synchronized (page) {
						try {
							page.wait(500);
							log.info("加载国家地区信息.......");
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
					}
				}
				
				HtmlInput contact_nameInput = (HtmlInput) page.getElementById("contact_name");
				String contact_name = contact_nameInput.getAttribute("value");
				map.put("contact_name", contact_name);
				log.info("contact_name==>" + contact_name);
				
				internationalPassengerInformationPage.setLS(CS.SUCCESS);
				log.info(internationalPassengerInformationPage.getLS());
				map.put("filist", fiList);
				map.put("fplist", fpList);
				map.put("internationalFlightInfo", internationalFlightInfo);
				map.put("baoxian", "0");
				
				return map;
			
			}
			synchronized (page) {
				try {
					page.wait(waittime);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				passengerInformationPage.setLS(CS.LOADING);
			}
		}
		passengerInformationPage.setLS(CS.TIMEOUT);
		log.info(passengerInformationPage.getLS());
		return null;
	}
	
	
	public CsairWebClient getWebClient() {
		return webClient;
	}

	// private CsairPage indexPage = new CsairPage(); // 首页
	private CsairPage loginPage = new CsairPage(); // 登录
	private CsairPage phonePage = new CsairPage(); // 手机登录
	private CsairPage registerPage = new CsairPage(); // 注册
	private CsairPage forgotPasswordPage = new CsairPage(); // 忘记密码
	// private CsairPage modifyPasswordPage = new CsairPage(); // 修改密码
	private CsairPage modifyPasswordPageSrc = new CsairPage(); // 修改密码
	private CsairPage orderQueryPage = new CsairPage(); // 订单查询
	private CsairPage refundPage = new CsairPage(); //退票页
	private CsairPage changePage = new CsairPage(); //变更页
	private CsairPage change2Page = new CsairPage(); //变更页2
	// 单程购票接口方法列表
	private CsairPage internationalFlihgtPage = new CsairPage(); // 国际航班查询
	private CsairPage flightQueryPage = new CsairPage(); // 航班查询
	private CsairPage lcExchangeListPage = new CsairPage(); // 里程兑换
	// private CsairPage flightSelectionPage = new CsairPage(); // 航班选择
	private CsairPage passengerInformationPage = new CsairPage(); // 旅客信息
	private CsairPage internationalPassengerInformationPage = new CsairPage(); // 国际旅客信息
	private CsairPage internationalPassengerInformationStyle1Page  = new CsairPage(); // 国际旅客信息样式一
	private CsairPage lcPassengerInformationPage = new CsairPage(); // 里程兑换旅客信息
	private CsairPage orderPaymentPage = new CsairPage(); // 订单支付
	private CsairPage orderLCPaymentPage = new CsairPage(); // 里程订单支付
	private CsairPage changePaymentPage = new CsairPage(); // 变更订单支付
	// private CsairPage paymentStatusPage = new CsairPage(); // 支付状态

	// 明珠会员接口方法列表
	// private CsairPage csairPage = new CsairPage(); // 明珠会员登录
	private CsairPage csairBaseInfoPage = new CsairPage(); // 明珠会员基本信息
	private CsairPage csairBaseInfoPageSrc = new CsairPage(); // 明珠会员基本信息src
	// private CsairPage csairModifyPasswordPage = new CsairPage(); // 明珠会员修改密码
	// private CsairPage csairContactInfoPage = new CsairPage(); // 明珠会员联系信息
	private CsairPage csairContactInfoPageSrc = new CsairPage(); // 明珠会员联系信息src
	// private CsairPage csairassigneeCtrlPage = new CsairPage(); // 明珠会员受让人管理
	// private CsairPage csairOnlineIdentityAuthenticationPage = new CsairPage(); //
	// 在线身份认证
	
	private CsairPage assigneeCtrlPage = new CsairPage(); // 受让人管理已认证页面
	private CsairPage csairOnlineIdentityAuthenticationPageSrc = new CsairPage(); // 在线身份认证src
	private CsairPage agreeCsairOnlineIdentityAuthenticationPage = new CsairPage(); // 同意在线身份认证
	private CsairPage checkYHQPage = new CsairPage(); // 优惠券
	private CsairPage checkLCHZ = new CsairPage(); // 里程汇总
	private CsairPage checkCitiesLCLj = new CsairPage(); // 城市间里程累积查询
	private CsairPage checkLcExchange = new CsairPage(); // 城市间里程累积查询
	private CsairPage commContactorPage = new CsairPage(); // 常用联系人
	private CsairPage commPassengerPage = new CsairPage(); // 常用联系人
	private CsairPage addCommContactorPage = new CsairPage(); // 增加常用联系人
	private CsairPage EditCommContactorPage = new CsairPage(); // 修改常用联系人
	private CsairPage viewCommPassengerPage = new CsairPage(); // 查看常用旅客信息
	private CsairPage addCommPassengerPage = new CsairPage(); // 增加常用旅客
	private CsairPage editCommPassengerPage = new CsairPage(); // 增加常用旅客
	private CsairPage checkBalancePage = new CsairPage(); // 查询余额
	private CsairPage nanFangHangKongPage = new CsairPage(); // 飞行里程南航航空
	private CsairPage tianHeLianMengHangKongPage = new CsairPage(); // 飞行里程天合联盟
	private CsairPage othersPage = new CsairPage(); // 飞行里程其他合作伙伴
	private CsairPage hotelMileage = new CsairPage(); // 酒店里程
	private CsairPage lianMingXinYongKa = new CsairPage(); // 刷卡里程联名信用卡
	private CsairPage yinHangJiFenDuiHuan = new CsairPage(); // 刷卡里程银行积分兑换
	private CsairPage zuChe = new CsairPage(); // 其他合作伙伴里程租车
	private CsairPage shangLv = new CsairPage(); // 其他合作伙伴里程商旅
	private CsairPage canYin = new CsairPage(); // 其他合作伙伴里程餐饮
	private CsairPage qiTa = new CsairPage(); // 其他合作伙伴里程其他
	private CsairPage mileageSupplementPage = new CsairPage(); // 里程补登
	private CsairPage mileageDelayPage = new CsairPage(); // 里程延期
	private CsairPage h_courtesyPage = new CsairPage(); // 高端礼遇
	private CsairPage SMSfunction = new CsairPage(); // 明珠会员尊享短信功能
	private CsairPage SMSonDuty = new CsairPage(); // 明珠会员尊享短信功能
	private CsairPage SMSadmission = new CsairPage(); // 短信加入
	private CsairPage visaPage = new CsairPage(); // 便捷签证
	private CsairPage mz_courtesyPage = new CsairPage(); // 便捷签证
	private CsairPage introductionPage = new CsairPage(); // 简介
	private CsairPage membershipLevelPage = new CsairPage(); // 会员级别
	private CsairPage membershipRightsPage = new CsairPage(); // 会员级别
	private CsairPage tianheEnjoy = new CsairPage(); // 天合优享
	private CsairPage hotActivity = new CsairPage(); // 热点活动
	private CsairPage lines = new CsairPage(); // 热点活动
	private CsairPage banking = new CsairPage(); // 银行
	private CsairPage hotels = new CsairPage(); // 酒店
	private CsairPage cars = new CsairPage(); // 租车
	private CsairPage travels = new CsairPage(); // 旅游
	private CsairPage booking = new CsairPage(); // 酒店预订网
	private CsairPage others = new CsairPage(); // 其他
	private CsairPage clubInfo = new CsairPage(); // 其他
	
	private CsairPage lieBiaoContent = new CsairPage(); // 列表链接内容
	private CsairPage userFeedbackPage = new CsairPage(); // 用户反馈
	private CsairPage CsairSearchPage = new CsairPage(); // 全站搜索
	

	// 出行帮助
	private CsairPage specialpassengerPage = new CsairPage();// 特殊旅客出行提示
	private CsairPage mobilitydisordersPage = new CsairPage();// 行动障碍旅客
	private CsairPage visionhearingimpairmentPage = new CsairPage();// 视力或听力障碍旅客

	//附加服务
	private CsairPage flightDynamicsPlacePage = new CsairPage();// 航班动态(出发、到达地点)
	private CsairPage flightDynamicsNumPage = new CsairPage();// 航班动态(航班号)
	
	
	private String URLinternationalflightQuery = null;
	private CsairPage internationalFlightQuery = new CsairPage();//国际查询
	private String URLinternationalflightQuery2 = null;
	private CsairPage internationalFlightQuery2 = new CsairPage();//国际查询

	


	
}
